@font-face {
  font-family: "Host Grotesk";
  src: url("./fonts/host-grotesk-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("./fonts/dm-sans-400.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "DM Sans", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  color: #fff;
  background: #0a0a0a;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100svh;
  overflow-x: hidden;
  background: #0a0a0a;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

#gradient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  animation: reveal-canvas 1.6s ease-out .1s forwards;
  -webkit-mask-image: linear-gradient(#000000fc 0%, #000000e8 8.98%, transparent 100%);
  mask-image: linear-gradient(#000000fc 0%, #000000e8 8.98%, transparent 100%);
}

#grid-canvas,
#logo-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000000fc 0%, #000000e8 8.98%, transparent 100%);
  mask-image: linear-gradient(#000000fc 0%, #000000e8 8.98%, transparent 100%);
}

#grid-canvas {
  z-index: 2;
  opacity: 1;
}

#logo-particles {
  z-index: 1;
  opacity: .72;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 14px rgba(170,202,255,.28));
  animation: reveal-particles 1.8s ease-out .25s both;
}

@media (hover: none), (pointer: coarse) {
  #grid-canvas,
  #logo-particles { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #logo-particles { animation: none; }
}

/* Legacy mask retained for browsers that composite fixed canvases late. */
.official-grid {
  display: none;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0, #000 15%, #000 85%, transparent),
    linear-gradient(180deg, #000 0, #000 70%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0, #000 15%, #000 85%, transparent),
    linear-gradient(180deg, #000 0, #000 70%, transparent 100%);
  mask-composite: intersect;
}

.site-header {
  position: relative;
  z-index: 10;
  width: min(calc(100% - 48px), 1280px);
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo { display: block; width: 227px; height: 23px; filter: invert(1); }

.product-badge {
  display: inline-flex;
  padding: 1px;
  margin-left: 2px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(255,255,255,.08) 38%, rgba(255,255,255,.48));
  box-shadow: 0 0 24px rgba(255,255,255,.09);
}

.product-badge span {
  padding: 4px 9px 3px;
  border-radius: 7px;
  color: rgba(255,255,255,.95);
  background: rgba(0,0,0,.72);
  font: 500 11px/1 ui-monospace, "PingFang SC", monospace;
  white-space: nowrap;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  backdrop-filter: blur(12px);
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}

.header-link svg { width: 16px; }
.header-link:hover { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); }

.hero {
  position: relative;
  z-index: 3;
  width: min(calc(100% - 48px), 1140px);
  min-height: calc(100svh - 132px);
  margin: 0 auto;
  padding: clamp(46px, 7vh, 88px) 0 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-copy { display: flex; flex-direction: column; align-items: center; }

.eyebrow {
  margin: 0 0 18px;
  color: rgba(255,255,255,.9);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.01em;
}

h1 {
  margin: 0;
  font-family: "Host Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(44px, 6.4vw, 76px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.045em;
  text-shadow: 0 0 48px rgba(161,190,255,.12);
}

h1 span { display: inline; }
.title-desktop { margin-left: .22em; }

.subtitle {
  max-width: 760px;
  margin: 24px 0 0;
  color: rgba(255,255,255,.54);
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.7;
}

.downloads {
  position: relative;
  z-index: 20;
  margin-top: 34px;
  display: flex;
  justify-content: center;
  gap: 14px;
  pointer-events: auto;
}

.button {
  position: relative;
  z-index: 1;
  min-width: 208px;
  min-height: 58px;
  padding: 10px 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .35s cubic-bezier(.16,1,.3,1), border-color .25s ease, box-shadow .25s ease;
}

.button > * { pointer-events: none; }

.button::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  z-index: -1;
  width: 150%; aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  transition: transform .42s ease-out, opacity .15s ease;
}

.button:hover { transform: translateY(-3px); }
.button:hover::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.button-primary { color: #0a0a0a; background: #fff; box-shadow: 0 10px 34px rgba(255,255,255,.08); }
.button-primary::after { background: rgba(73,104,255,.16); }
.button-secondary { color: #fff; background: rgba(255,255,255,.065); border-color: rgba(255,255,255,.16); backdrop-filter: blur(15px); }
.button-secondary::after { background: rgba(255,255,255,.13); }
.button-secondary:hover { border-color: rgba(255,255,255,.42); }
.button strong, .button small { display: block; }
.button strong { font-size: 15px; font-weight: 500; line-height: 1.25; }
.button small { margin-top: 4px; font-size: 11px; opacity: .52; white-space: nowrap; }
.button-icon { width: 19px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; }
.button-icon svg { display: block; width: 100%; height: 100%; }
.button-icon .windows-symbol { display: none; width: 20px; height: 20px; }
.button-icon.windows-icon .apple-symbol { display: none; }
.button-icon.windows-icon .windows-symbol { display: block; }
.download-count {
  position: relative;
  z-index: 3;
  margin: 18px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.54);
  font-size: 13px;
}
.download-count svg { width: 17px; height: 17px; }
.download-count strong { color: rgba(255,255,255,.78); font-weight: 500; font-variant-numeric: tabular-nums; }
.download-note { margin: 12px 0 0; color: rgba(255,255,255,.34); font-size: 12px; }

.product-stage {
  position: relative;
  width: min(94%, 940px);
  margin-top: clamp(52px, 8vh, 92px);
  perspective: 1400px;
}

.theme-switcher {
  position: relative;
  z-index: 3;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 18px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(12,14,20,.62);
  box-shadow: 0 10px 34px rgba(0,0,0,.25);
  backdrop-filter: blur(18px);
}

.theme-tab {
  height: 34px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  color: rgba(255,255,255,.46);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .25s ease, background .25s ease, box-shadow .25s ease;
}

.theme-tab:hover { color: rgba(255,255,255,.82); }
.theme-tab.is-active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.16); }
.theme-tab:focus-visible { outline: 2px solid #7fa4ff; outline-offset: 2px; }
.theme-dot { width: 7px; height: 7px; border-radius: 50%; background: #586174; box-shadow: 0 0 8px currentColor; }
.dot-wechat { background: #38bc70; }
.dot-soft { background: linear-gradient(135deg, #ffd9c9, #d9dfff); }
.dot-custom { background: linear-gradient(135deg, #ff5f57, #fa42a4 48%, #6e5cff); }

.theme-caption {
  position: relative;
  z-index: 2;
  margin: 0 auto 14px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  color: rgba(255,255,255,.8);
  font-size: 13px;
}

.theme-caption small { color: rgba(255,255,255,.35); font-size: 11px; }

.stage-glow {
  position: absolute;
  inset: -25% 7% -10%;
  background: radial-gradient(ellipse, rgba(86,126,255,.24), transparent 62%);
  filter: blur(48px);
  opacity: .8;
}

.app-window {
  --app-bg: #141518;
  --sidebar-bg: #242426;
  --panel-bg: #2d2d2f;
  --panel-hover: #38383a;
  --text: #f5f5f6;
  --muted: #92949b;
  --line: rgba(255,255,255,.08);
  --accent: #7895d4;
  --accent-text: #fff;
  --radius: 10px;
  --panel-shadow: none;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 13px;
  padding: 10px;
  background: rgba(7,9,14,.86);
  box-shadow: 0 0 0 1px rgba(0,0,0,.8), 0 40px 90px rgba(0,0,0,.72), 0 0 90px rgba(90,126,255,.12);
  transform: rotateX(2deg);
  transform-origin: center bottom;
  transition: transform .7s cubic-bezier(.16,1,.3,1), box-shadow .7s ease;
}

.product-stage:hover .app-window { transform: rotateX(0) translateY(-5px); box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 50px 110px rgba(0,0,0,.78), 0 0 110px rgba(90,126,255,.16); }
.theme-image { display: block; width: 100%; height: auto; aspect-ratio: 3104 / 2064; object-fit: cover; border-radius: 8px; transition: opacity .2s ease, transform .5s ease; }
.app-window.is-switching .theme-image { opacity: .25; transform: scale(.992); }
.app-window.theme-default { background: rgba(7,9,14,.86); }
.app-window.theme-wechat { background: #dceee4; border-color: rgba(64,205,126,.28); box-shadow: 0 40px 90px rgba(0,0,0,.66), 0 0 95px rgba(44,190,104,.14); }
.app-window.theme-soft { background: linear-gradient(135deg, rgba(255,223,209,.62), rgba(222,224,255,.62)); border-color: rgba(255,255,255,.6); box-shadow: 0 40px 90px rgba(0,0,0,.6), 0 0 100px rgba(229,206,255,.18); }
.app-window.theme-custom { background: linear-gradient(135deg, #1bbfa0, #365ee8 52%, #833ce2); border-color: rgba(255,255,255,.3); box-shadow: 0 40px 90px rgba(0,0,0,.68), 0 0 110px rgba(80,100,255,.24); }

footer {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 48px), 1140px);
  margin: 0 auto;
  padding: 24px 0 30px;
  display: flex;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,.26);
  font-size: 11px;
}

footer a { transition: color .2s ease; }
footer a:hover { color: rgba(255,255,255,.7); }

.enter { animation: enter .9s ease-out backwards; }
.enter-1 { animation-delay: .05s; --enter-y: 20px; --enter-blur: 8px; }
.enter-2 { animation-delay: .14s; --enter-y: 24px; --enter-blur: 10px; }
.enter-3 { animation-delay: .24s; --enter-y: 20px; --enter-blur: 7px; }
.enter-4 { animation-delay: .36s; --enter-y: 16px; --enter-blur: 3px; }
.enter-5 { animation-delay: .48s; --enter-y: 20px; --enter-blur: 6px; }

@keyframes enter { from { opacity: 0; transform: translateY(var(--enter-y, 20px)); filter: blur(var(--enter-blur, 0)); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes reveal-canvas { to { opacity: 1; } }
@keyframes reveal-particles { from { opacity: 0; } to { opacity: .72; } }

@media (max-width: 700px) {
  .site-header { height: 68px; }
  .brand-logo { width: 190px; height: auto; }
  .product-badge span { padding-inline: 7px; font-size: 10px; }
  .header-link { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 0; }
  .hero { padding-top: 42px; }
  .eyebrow { font-size: 15px; }
  h1 { width: 100%; font-size: clamp(34px, 9.5vw, 42px); line-height: 1.12; }
  h1 span { display: block; white-space: normal; }
  h1 span:first-child { max-width: 100%; }
  .title-desktop { margin: 7px 0 0; }
  .subtitle { margin-top: 20px; font-size: 16px; }
  .downloads { width: 100%; flex-direction: column; align-items: stretch; }
  .button { width: 100%; }
  .product-stage { width: 100%; margin-top: 58px; }
  .app-window { border-radius: 9px; transform: none; }
  .theme-image { width: 100%; }
  .theme-switcher { width: 100%; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .theme-switcher::-webkit-scrollbar { display: none; }
  .theme-tab { padding-inline: 11px; }
  .theme-caption { flex-direction: column; align-items: center; gap: 3px; }
  footer { flex-wrap: wrap; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
