/* ==========================================================================
   WubbaLab Studio Core UI & Motion System (v2 — Enhanced with Redhare Craft)
   - Bilingual Chinese Detection Banner (Browser Lang + Timezone + Country)
   - 4-Locale Switcher (EN / 中文 / 日本語 / 한국어)
   - Pointer-Tracking Radial Glow Spotlight & Specular Shimmer Buttons
   - Scroll Progress Bar, Motion Telemetry HUD & Staggered Scroll Reveal
   - Download Hub Modal + Built-in TestFlight / Inquiry Lead Form (Honeypot)
   ========================================================================== */

:root {
  --wl-banner-height: 0px;
  --wl-page-progress: 0%;
  --wl-z-hud: 90;
  --wl-z-banner: 9999;
  --wl-z-modal: 10000;
  --wl-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top hairline scroll progress bar */
.wl-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: var(--wl-page-progress, 0%);
  background: linear-gradient(90deg, #34d399, #38bdf8, #e5c687);
  z-index: 10001;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* Subtle bottom-right Motion HUD (inspired by Redhare MotionHud) */
.wl-motion-hud {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--wl-z-hud);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(226, 232, 240, 0.78);
  font: 600 11px/1 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s var(--wl-ease-out), border-color 0.18s ease;
}

.wl-motion-hud.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.wl-motion-hud:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.wl-motion-hud__pct {
  color: #38bdf8;
  font-weight: 700;
}

/* Staggered Scroll Reveal Choreography */
.wl-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.68s var(--wl-ease-out) var(--wl-reveal-delay, 0ms),
    transform 0.68s var(--wl-ease-out) var(--wl-reveal-delay, 0ms);
  will-change: opacity, transform;
}

.wl-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .wl-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Pointer-Tracking Radial Spotlight on Interactive Cards (Redhare glow-card) */
.wl-glow-card {
  position: relative;
}

.wl-glow-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    360px circle at var(--wl-glow-x, 50%) var(--wl-glow-y, 50%),
    rgba(255, 255, 255, 0.075),
    transparent 65%
  );
  transition: opacity 0.3s ease;
}

.wl-glow-card:hover::after {
  opacity: 1;
}

/* Specular Light-Sweep on Primary Download Buttons (Redhare shimmer sweep) */
[data-app-download] {
  position: relative;
  overflow: hidden;
}

[data-app-download]::before {
  content: "";
  position: absolute;
  inset: -45% auto -45% -45%;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: translateX(-190%) skewX(-18deg);
  transition: transform 0.65s var(--wl-ease-out);
  pointer-events: none;
}

[data-app-download]:hover::before {
  transform: translateX(460%) skewX(-18deg);
}

/* Smooth page offset when Chinese browser detection banner is visible */
html.wl-has-zh-banner body {
  padding-top: var(--wl-banner-offset, 64px);
  transition: padding-top 0.35s var(--wl-ease-out);
}

/* Top Bilingual Chinese Language Detection Banner */
.wl-zh-detect-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--wl-z-banner);
  background: linear-gradient(90deg, rgba(8, 13, 21, 0.97) 0%, rgba(14, 26, 34, 0.97) 50%, rgba(8, 13, 21, 0.97) 100%);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", sans-serif;
  transform: translateY(-105%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.42s var(--wl-ease-out), opacity 0.32s ease;
}

.wl-zh-detect-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.wl-zh-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wl-zh-banner-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.wl-zh-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
  flex-shrink: 0;
  animation: wlPulse 2.2s infinite ease-in-out;
}

@keyframes wlPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0.32); }
}

.wl-zh-lines {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wl-zh-line-primary {
  font-size: 13.5px;
  font-weight: 650;
  color: #ffffff;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.wl-zh-line-secondary {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.35;
}

.wl-zh-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wl-zh-btn-switch {
  appearance: none;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.wl-zh-btn-switch:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.wl-zh-btn-keep {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(241, 245, 249, 0.88);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.wl-zh-btn-keep:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.wl-zh-btn-close {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(203, 213, 225, 0.72);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wl-zh-btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Unified 4-Language Switcher Pill */
.wl-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wl-lang-switcher.is-light {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
}

.wl-lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(241, 245, 249, 0.72);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4.5px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  line-height: 1.2;
}

.wl-lang-switcher.is-light .wl-lang-btn {
  color: rgba(15, 23, 42, 0.65);
}

.wl-lang-btn:hover { color: #ffffff; }
.wl-lang-switcher.is-light .wl-lang-btn:hover { color: #0f172a; }

.wl-lang-btn.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wl-lang-switcher.is-light .wl-lang-btn.is-active {
  background: #0f172a;
  color: #ffffff;
}

/* Download Status / Hub Modal + Built-in Beta Lead Capture */
.wl-dl-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--wl-z-modal);
  background: rgba(3, 7, 15, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.wl-dl-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.wl-dl-modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 26px;
  background: linear-gradient(165deg, #111827 0%, #090d16 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  padding: 28px;
  color: #f8fafc;
  position: relative;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s var(--wl-ease-out);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans", sans-serif;
}

.wl-dl-modal-backdrop.is-open .wl-dl-modal {
  transform: translateY(0) scale(1);
}

.wl-dl-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wl-dl-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.wl-dl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 14px;
}

.wl-dl-title {
  font-size: 22px;
  font-weight: 750;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.wl-dl-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.8);
  margin: 0 0 18px;
}

.wl-dl-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wl-dl-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-radius: 15px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.wl-dl-action.primary {
  background: #ffffff;
  color: #090d16;
}

.wl-dl-action.secondary {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.wl-dl-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* Lead Capture Box inside Modal (Redhare LeadForm + Honeypot pattern) */
.wl-lead-box {
  margin-top: 16px;
  padding: 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.wl-lead-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #e2e8f0;
}

.wl-lead-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.wl-lead-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-size: 12.5px;
  font-family: inherit;
}

.wl-lead-input:focus {
  outline: none;
  border-color: #38bdf8;
}

.wl-lead-submit {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #38bdf8, #34d399);
  color: #05101a;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.wl-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.wl-dl-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Studio Top Breadcrumb Pill for Sub-Sites */
.wl-studio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  color: rgba(241, 245, 249, 0.78);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  transition: all 0.18s ease;
}

.wl-studio-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

@media (max-width: 640px) {
  .wl-zh-banner-inner {
    padding: 9px 14px;
    gap: 10px;
  }
  .wl-zh-line-primary { font-size: 12.5px; }
  .wl-zh-line-secondary { font-size: 11px; }
  .wl-zh-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .wl-motion-hud {
    right: 12px;
    bottom: 12px;
    font-size: 10px;
  }
}
