/* ============================================================================
   CanteenStartupIntro v2.0 — Sculpted Particle Image Cinema Opening
   - Inspired by Rice-dog/code-codex Particle Image (sculpted luminous dust)
   - Dedicated matte-obsidian backdrop (.wb-intro-bg) dissolves independently
     so 4,000+ particles physically scatter & evaporate directly OVER the real
     revealed page on Left-Click, Right-Click, or Auto-Finish!
   - Zero white flash via synchronous html.wb-intro-hold guard
   - 100% CSP style-src 'self' compliant (zero inline styles)
   ============================================================================ */

html.wb-intro-hold,
html.wb-intro-hold body {
  background: #050608 !important;
  overflow: hidden !important;
}

html.wb-intro-hold .app,
html.wb-intro-hold .auth-shell {
  opacity: 0 !important;
}

.wb-intro {
  position: fixed;
  inset: 0;
  z-index: 2147483500;
  overflow: hidden;
  background: transparent;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* During scatter phase, immediately pass pointer events through to real UI */
.wb-intro.is-scattering {
  pointer-events: none;
  cursor: default;
}

/* Separate matte-obsidian backdrop so particles scatter visibly over the revealed page */
.wb-intro-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 86% 78% at 50% 42%,
    #0e1016 0%,
    #06070a 56%,
    #030406 100%
  );
  opacity: 1;
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1) 85ms;
  pointer-events: none;
}

.wb-intro.is-skipping .wb-intro-bg {
  transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1) 55ms;
}

.wb-intro.is-scattering .wb-intro-bg {
  opacity: 0;
}

/* Transparent particle canvas stays alive on top while scattering */
.wb-intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
}

/* Centered Frosted-Glass Brand Lockup floating over the cosmic particle galaxy */
.wb-intro-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 0 24px;
  pointer-events: none;
  transition: opacity 240ms cubic-bezier(0.22, 1, 0.36, 1), transform 320ms cubic-bezier(0.22, 1, 0.36, 1), filter 240ms ease;
}

.wb-intro.is-scattering .wb-intro-stage {
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(1.06);
  filter: blur(6px);
}

.wb-intro-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  background: rgba(12, 13, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 14px 34px rgba(0, 0, 0, 0.52);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 24px;
  font-weight: 700;
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.88);
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1), transform 580ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wb-intro.is-brand .wb-intro-mark {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.wb-intro-mask {
  display: block;
  overflow: hidden;
  padding: 2px 8px;
}

.wb-intro-title {
  display: inline-block;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  line-height: 1.25;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.88);
  transform: translate3d(0, 120%, 0);
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1) 70ms;
}

.wb-intro.is-brand .wb-intro-title {
  transform: translate3d(0, 0, 0);
}

.wb-intro-sub {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: rgba(236, 239, 244, 0.72);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.92);
  transform: translate3d(0, 120%, 0);
  transition: transform 580ms cubic-bezier(0.22, 1, 0.36, 1) 140ms;
}

.wb-intro.is-brand .wb-intro-sub {
  transform: translate3d(0, 0, 0);
}

/* Bottom Minimal Progress Rail & Skip Cue */
.wb-intro-foot {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom, 28px));
  transform: translate3d(-50%, 10px, 0);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 380ms ease 240ms, transform 460ms cubic-bezier(0.22, 1, 0.36, 1) 240ms;
}

.wb-intro.is-ready .wb-intro-foot {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.wb-intro.is-scattering .wb-intro-foot {
  opacity: 0;
  transform: translate3d(-50%, 6px, 0);
  transition: opacity 180ms ease, transform 200ms ease;
}

.wb-intro-rail {
  width: 128px;
  height: 1.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.wb-intro-rail-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(248, 244, 236, 0.90);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.wb-intro-hint {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  color: rgba(255, 255, 255, 0.50);
  white-space: nowrap;
}

/* Discrete Replay Trigger for Login Footer */
.wb-intro-replay-link {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  padding: 0 2px;
  margin-left: 8px;
  cursor: pointer;
  opacity: 0.68;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 160ms ease;
}

.wb-intro-replay-link:hover {
  opacity: 1;
}

@media (max-width: 640px) {
  .wb-intro-stage {
    transform: translate3d(-50%, 50px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wb-intro { display: none !important; }
  html.wb-intro-hold .app,
  html.wb-intro-hold .auth-shell { opacity: 1 !important; }
}
