/* Opening intro integrated into index.html. Remove the <link>/<script> for it to disable. */
.intro { display: none; }
html.intro-on, html.intro-on body { overflow: hidden; }
html.intro-on .intro {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: radial-gradient(60% 50% at 50% 42%, #0d1124 0%, #050507 70%);
  font-family: "MinisCloud Final PingFang SC", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #f5f5f7;
}
/* While intro is active the guide sits underneath, untouched */
html.intro-on .guide-root { visibility: hidden; }
html.intro-revealing .guide-root { visibility: visible; position: relative; z-index: 1001; will-change: clip-path; background: var(--fg-bg, #04050a); }
.intro-content { display: flex; flex-direction: column; align-items: center; transform: translateY(-16px); }
.intro-button { position: relative; isolation: isolate; display: block; width: clamp(150px, 16vw, 188px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 28%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.intro-button:focus-visible { outline: 2px solid #9db4ff; outline-offset: 10px; }
.intro-new { position: relative; z-index: 2; display: block; width: 100%; height: auto; opacity: 0; user-select: none; }
.intro-old { position: absolute; z-index: 3; left: 8.8%; top: 9.2%; width: 82.4%; height: auto; border-radius: 26%; user-select: none;
  animation: intro-breathe 3.2s ease-in-out infinite; }
.intro-glow { position: absolute; z-index: 1; inset: -20%; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(170,205,255,.95), rgba(90,150,255,.45) 45%, transparent 72%); filter: blur(6px); }
.intro-button:hover .intro-old { transform: scale(1.03); transition: transform .35s cubic-bezier(.22,1,.36,1); }
@keyframes intro-breathe { 0%,100% { box-shadow: 0 24px 60px -18px rgba(70,120,255,.45); } 50% { box-shadow: 0 24px 80px -10px rgba(90,140,255,.75); } }
.intro-copy { display: grid; justify-items: center; margin-top: 32px; padding-inline: 20px; }
.intro-copy > p { grid-area: 1 / 1; margin: 0; text-align: center; }
.intro-hint, .intro-tagline { font-size: clamp(20px, 2.2vw, 28px); font-weight: 600; letter-spacing: .02em; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.intro-hint { background-image: linear-gradient(120deg, #fff 20%, #b9c9ff 70%, #c9b6ff); }
.intro-tagline { opacity: 0; background-image: linear-gradient(120deg, #fff 10%, #9fd6ff 55%, #7aa8ff); }
.intro-sub { grid-area: 2 / 1 !important; margin-top: 12px !important; font-size: 13px; letter-spacing: .24em; color: #8d92a6; }
.intro-skip { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); min-height: 40px; padding: 8px 18px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(255,255,255,.04); color: #a9adbd; font: inherit; font-size: 13px; cursor: pointer; }
.intro-skip:hover { color: #fff; background: rgba(255,255,255,.08); }
@media (prefers-reduced-motion: reduce) { .intro-old { animation: none; } }

/* Bilingual tagline: Chinese headline + English line */
.intro-tagline { display: grid; justify-items: center; gap: 8px; }
.intro-tagline > span { -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; background-image: inherit; }
.intro-tagline-en { font-size: clamp(14px, 1.3vw, 17px); font-weight: 500; letter-spacing: .04em; opacity: .85; }
.intro-hint { min-height: 1.4em; }

/* Loading progress */
.intro-progress { position: fixed; left: 50%; bottom: max(40px, calc(env(safe-area-inset-bottom) + 28px)); transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px; width: min(260px, 70vw); transition: opacity .6s ease .3s; }
.intro-progress-track { position: relative; display: block; width: 100%; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.08); }
.intro-progress-fill { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(.02); border-radius: inherit;
  background: linear-gradient(90deg, #7aa8ff, #c6b3ff); box-shadow: 0 0 12px rgba(157,180,255,.7); }
.intro-progress-label { font-size: 12px; letter-spacing: .08em; color: #8d92a6; font-variant-numeric: tabular-nums; }
.intro-progress-label b { font-weight: 500; color: #c9d2ff; }
.intro-progress.is-done { opacity: 0; pointer-events: none; }
.intro-progress.is-waiting:not(.is-done) .intro-progress-label { color: #c9d2ff; }
@media (max-width: 600px) { .intro-progress { bottom: max(84px, calc(env(safe-area-inset-bottom) + 72px)); } }

/* Top bar when the intro is skipped */
.load-topbar { position: fixed; inset: 0 0 auto; z-index: 2000; height: 2px; pointer-events: none; transition: opacity .5s ease .2s; }
.load-topbar span { display: block; height: 100%; transform-origin: left; transform: scaleX(.04); background: linear-gradient(90deg, #7aa8ff, #c6b3ff); box-shadow: 0 0 10px rgba(157,180,255,.8); transition: transform .4s cubic-bezier(.22,1,.36,1); }
.load-topbar.is-done { opacity: 0; }
.intro-progress.is-ready .intro-progress-label b { color: #9fe0b8; }
.intro-progress.is-ready .intro-progress-fill { background: linear-gradient(90deg, #7ee2a8, #9db4ff); }
.intro-progress-label { transition: color .3s; }
