/* ==========================================================================
   Pocketmice Channel — Minimal Blue-Canvas Landing & Download Page
   Faithfully mirrors Pocketmice's blue login stage (app.pocketmice.bitmiracle.cn/login)
   with the dynamic bell-holding pocket mouse peeking out of its folder box.
   ========================================================================== */

:root {
  --canvas: #1a56f0;
  --canvas-text: #ffffff;
  --canvas-muted: rgba(255, 255, 255, 0.84);

  --card-bg: #ffffff;
  --card-fg: #171717;
  --card-muted: #737373;
  --card-ring: rgba(22, 36, 86, 0.06);
  --card-shadow: 0 24px 54px -18px rgba(10, 26, 84, 0.36), 0 2px 10px rgba(10, 26, 84, 0.1);
  --folder-tab: color-mix(in srgb, white 30%, var(--canvas));

  --chime-bg: #f1f5ff;
  --chime-fg: #193cb8;
  --chime-ring: rgba(26, 86, 240, 0.14);

  --cta-bg: #ffffff;
  --cta-hover: #f4f7ff;
  --cta-fg: #1a56f0;
  --cta-shadow: 0 14px 32px -12px rgba(10, 26, 84, 0.36);

  --control-bg: rgba(255, 255, 255, 0.16);
  --control-hover: rgba(255, 255, 255, 0.24);
  --control-border: rgba(255, 255, 255, 0.22);
  --control-fg: #ffffff;

  --ring-focus: rgba(255, 255, 255, 0.55);

  --font-body: "Figtree", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-display: "Gabarito", "Figtree", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;

  color-scheme: light;
}

html.dark {
  --canvas: #0e1b42;
  --canvas-text: #f8fafc;
  --canvas-muted: rgba(226, 232, 240, 0.8);

  --card-bg: #192238;
  --card-fg: #f8fafc;
  --card-muted: #94a3b8;
  --card-ring: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 28px 60px -18px rgba(0, 0, 0, 0.65), 0 2px 10px rgba(0, 0, 0, 0.35);
  --folder-tab: color-mix(in srgb, #60a5fa 26%, var(--canvas));

  --chime-bg: rgba(59, 130, 246, 0.14);
  --chime-fg: #93c5fd;
  --chime-ring: rgba(147, 197, 253, 0.18);

  --cta-bg: #2563eb;
  --cta-hover: #3b82f6;
  --cta-fg: #ffffff;
  --cta-shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.55);

  --control-bg: rgba(255, 255, 255, 0.1);
  --control-hover: rgba(255, 255, 255, 0.18);
  --control-border: rgba(255, 255, 255, 0.16);
  --control-fg: #f8fafc;

  --ring-focus: rgba(147, 197, 253, 0.55);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--canvas);
  color: var(--canvas-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 200ms ease, color 200ms ease;
}

button,
a {
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   Top-Right Minimal Controls (中/EN + Light/Dark ONLY)
   ========================================================================== */

.top-controls {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-pill,
.control-circle {
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--control-fg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background-color 140ms ease, transform 90ms ease;
}

.control-pill {
  padding: 0 13px;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
}

.control-circle {
  width: 36px;
  padding: 0;
}

.control-pill:hover,
.control-circle:hover {
  background: var(--control-hover);
}

.control-pill:active,
.control-circle:active {
  transform: translateY(1px);
}

.control-pill:focus-visible,
.control-circle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring-focus);
}

.control-circle svg {
  width: 17px;
  height: 17px;
}

.lang-opt {
  opacity: 0.6;
  transition: opacity 140ms ease;
}

.lang-sep {
  opacity: 0.4;
}

html[lang="zh-Hans"] .lang-opt[data-lang-label="zh-Hans"],
html[lang="en"] .lang-opt[data-lang-label="en"] {
  opacity: 1;
  font-weight: 600;
}

/* ==========================================================================
   Main Centered Stage
   ========================================================================== */

.stage {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 24px 48px;
}

.centerpiece {
  width: 100%;
  max-width: 392px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ==========================================================================
   Folder Box & Dynamic Bell-Holding Mouse
   ========================================================================== */

.pocket-box {
  position: relative;
  z-index: 0;
  width: 100%;
  margin-top: 28px;
}

.folder-back {
  position: absolute;
  inset-inline: 0;
  top: -41px;
  height: 70px;
  z-index: -20;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  pointer-events: none;
}

.folder-tab-svg {
  flex-shrink: 0;
  fill: var(--folder-tab);
  transition: fill 200ms ease;
}

.folder-tab-wing {
  margin-left: -1px;
  margin-top: 13px;
  height: 100%;
  flex: 1;
  border-top-right-radius: 24px;
  background: var(--folder-tab);
  transition: background-color 200ms ease;
}

/* Peeking Mouse SVG */
.mouse-svg {
  position: absolute;
  left: var(--spot-left, 58%);
  top: -72.8px;
  margin-left: -56px;
  z-index: -10;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  transition: left 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mouse-rise {
  animation: mouse-rise 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mouse-pose {
  cursor: pointer;
  transform: translateY(0px);
  transition: transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1) 140ms;
}

.pocket-box[data-pose="shy"] .mouse-pose {
  transform: translateY(9.4px);
  transition: transform 260ms cubic-bezier(0.3, 0, 0.2, 1);
}

.pocket-box[data-pose="peek"] .mouse-pose {
  transform: translateY(4.6px);
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pocket-box[data-pose="ducked"] .mouse-pose {
  transform: translateY(19px) scale(1.07, 0.88);
  transition: transform 150ms cubic-bezier(0.5, 0, 1, 0.5);
}

.mouse-act {
  transform-origin: 0px 9px;
}

.pocket-box[data-act="happy"] .mouse-act {
  animation: mouse-rock 520ms ease-in-out infinite alternate;
}

.pocket-box[data-act="dizzy"] .mouse-act {
  animation: mouse-sway 750ms ease-in-out infinite alternate;
}

.pocket-box[data-act="asleep"] .mouse-act {
  --look-x: 0;
  --look-y: 0.5;
  animation: mouse-doze 2.6s ease-in-out infinite alternate;
}

.pocket-box[data-act="startled"] .mouse-act {
  animation: mouse-start 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.look-layer {
  transform: translate(
    calc(var(--look-x, 0) * var(--px, 0px)),
    calc(var(--look-y, 0) * var(--py, 0px))
  );
  transition: transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ear-left,
.ear-right {
  transform-box: fill-box;
}

.ear-left {
  transform-origin: bottom right;
}

.ear-right {
  transform-origin: bottom left;
  animation: mouse-twitch 6.5s ease-in-out infinite;
}

.pocket-box[data-act="happy"] .ear-left,
.pocket-box[data-act="happy"] .ear-right {
  animation: mouse-wiggle 260ms ease-in-out infinite alternate;
}

.eyes-normal {
  transform-box: fill-box;
  transform-origin: center;
  animation: mouse-blink 5.2s ease-in-out infinite;
}

.dizzy-spiral {
  animation: spin 0.9s linear infinite;
}

.z-glyph {
  transform-origin: 10px -10px;
  animation: mouse-z 2.7s ease-out infinite;
}

.star-glyph {
  animation: mouse-star 1.3s ease-in-out infinite alternate;
}

/* Front Card */
.box-card {
  position: relative;
  border-radius: 28px;
  background: var(--card-bg);
  color: var(--card-fg);
  box-shadow: var(--card-shadow), 0 0 0 1px var(--card-ring);
  padding: 36px 28px 30px;
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.box-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.box-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--card-muted);
}

.box-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.box-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--card-fg);
}

html[lang="zh-Hans"] .box-title {
  letter-spacing: 0;
}

.chime-pill {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9999px;
  background: var(--chime-bg);
  color: var(--chime-fg);
  box-shadow: 0 0 0 1px var(--chime-ring);
  font-size: 13px;
  font-weight: 500;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 200ms ease;
}

.chime-pill.is-chiming {
  transform: scale(1.05);
}

.chime-at {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #1a56f0;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Left Paw on Card Rim */
.paw-left {
  position: absolute;
  left: var(--spot-left, 58%);
  top: -8.2px;
  margin-left: -32.3px;
  width: 19.5px;
  height: 18px;
  border-radius: 9px;
  background: #f3b866;
  z-index: 10;
  cursor: pointer;
  transform: scale(1);
  transition:
    left 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: paw-grab 520ms cubic-bezier(0.34, 1.56, 0.64, 1) 150ms both;
}

.pocket-box[data-pose="ducked"] .paw-left,
.pocket-box[data-pose="peek"] .paw-left {
  transform: scale(0);
  transition:
    left 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 110ms ease-in 40ms;
}

/* Right Paw + Golden Bell on Card Rim */
.bell-wrap {
  position: absolute;
  left: var(--spot-left, 58%);
  top: -21px;
  margin-left: 11px;
  z-index: 10;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transform: scale(1);
  transform-origin: 20px 14px;
  -webkit-tap-highlight-color: transparent;
  transition:
    left 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: paw-grab 520ms cubic-bezier(0.34, 1.56, 0.64, 1) 230ms both;
}

.bell-wrap:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

.pocket-box[data-pose="ducked"] .bell-wrap,
.pocket-box[data-pose="peek"] .bell-wrap {
  transform: scale(0);
  transition:
    left 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 110ms ease-in 40ms;
}

.bell-svg {
  display: block;
  overflow: visible;
}

.bell-swing {
  transform-origin: 0px 0px;
  transform: rotate(-18deg);
  transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bell-waves {
  opacity: 0;
  transition: opacity 180ms ease;
}

.bell-wrap:hover .bell-swing {
  transform: rotate(-28deg);
}

.bell-wrap:hover .bell-waves {
  opacity: 0.75;
}

.bell-wrap.is-ringing .bell-swing {
  animation: bell-ring 560ms ease-in-out infinite;
}

.bell-wrap.is-ringing .bell-waves {
  opacity: 1;
  animation: waves-flash 420ms ease-in-out infinite alternate;
}

/* ==========================================================================
   Minimal One-Line Slogan & Download Button Below Box
   ========================================================================== */

.slogan {
  margin: 26px 0 20px;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--canvas-muted);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 26px;
  border-radius: 9999px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--cta-shadow);
  transition:
    background-color 150ms ease,
    transform 110ms ease,
    box-shadow 150ms ease;
}

.download-btn:hover {
  background: var(--cta-hover);
  transform: translateY(-1px);
}

.download-btn:active {
  transform: translateY(1px);
}

.download-btn:focus-visible {
  outline: none;
  box-shadow: var(--cta-shadow), 0 0 0 3px var(--ring-focus);
}

.download-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ==========================================================================
   Keyframes & Reduced Motion
   ========================================================================== */

@keyframes mouse-rise {
  0% {
    transform: translateY(18px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes paw-grab {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes mouse-blink {
  0%, 92%, 100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.1);
  }
}

@keyframes mouse-twitch {
  0%, 86%, 100% {
    transform: rotate(0deg);
  }
  90% {
    transform: rotate(8deg);
  }
  94% {
    transform: rotate(-4deg);
  }
}

@keyframes mouse-wiggle {
  0% {
    transform: rotate(-7deg);
  }
  100% {
    transform: rotate(7deg);
  }
}

@keyframes mouse-rock {
  0% {
    transform: rotate(-4deg);
  }
  100% {
    transform: rotate(4deg);
  }
}

@keyframes mouse-sway {
  0% {
    transform: rotate(-7deg);
  }
  100% {
    transform: rotate(7deg);
  }
}

@keyframes mouse-doze {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(1.6px);
  }
}

@keyframes mouse-start {
  0% {
    transform: translateY(4px) scale(0.95);
  }
  60% {
    transform: translateY(-3px) scale(1.03);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes mouse-z {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.75);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(4px, -9px) scale(1.25);
  }
}

@keyframes mouse-star {
  0% {
    opacity: 0.45;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1.2);
  }
}

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

@keyframes waves-flash {
  0% {
    opacity: 0.45;
  }
  100% {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@media (max-width: 480px) {
  .top-controls {
    top: 16px;
    right: 16px;
  }

  .stage {
    padding: 88px 20px 40px;
  }

  .box-card {
    padding: 32px 20px 26px;
  }

  .box-title {
    font-size: 22px;
  }

  .slogan {
    font-size: 15.5px;
  }
}
