/* QQMouse site — dependency-free, 3-state theme (system / light / dark).
   Dark values apply for (a) system dark when no explicit choice is stored, and
   (b) an explicit dark choice. An explicit light choice forces light even under a
   dark system setting. This uses only standard CSS custom properties and
   prefers-color-scheme, so it works on Safari (iOS/macOS) as well as everywhere else. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --accent: #6d28d9;
  --accent-2: #8b5cf6;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0d1117;
    --bg-soft: #161b22;
    --card: #161b22;
    --text: #e6edf3;
    --muted: #9198a1;
    --border: #30363d;
    --accent: #a78bfa;
    --accent-2: #c4b5fd;
    --accent-contrast: #1a1030;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --card: #161b22;
  --text: #e6edf3;
  --muted: #9198a1;
  --border: #30363d;
  --accent: #a78bfa;
  --accent-2: #c4b5fd;
  --accent-contrast: #1a1030;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --accent: #6d28d9;
  --accent-2: #8b5cf6;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 6px;
}

.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.brand img {
  width: 28px;
  height: 28px;
}
.brand:hover {
  text-decoration: none;
}
.spacer {
  flex: 1;
}

/* Theme segmented control */
.theme-toggle {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.theme-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.theme-toggle button svg {
  width: 16px;
  height: 16px;
}
.theme-toggle button.is-active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.theme-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ghlink {
  display: inline-flex;
  align-items: center;
  color: var(--text);
}
.ghlink:hover {
  color: var(--accent);
}

/* Hero */
.hero {
  padding: 72px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.05;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.hero .tag {
  font-size: clamp(17px, 2.5vw, 21px);
  color: var(--muted);
  margin: 0 auto 28px;
  max-width: 640px;
}
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Hero mascot — hangs from a top pivot and swings side to side like a pendulum. */
.hero-art {
  display: flex;
  justify-content: center;
  margin: 0 auto 22px;
  overflow: visible;
}
.hero-art img {
  width: clamp(200px, 42vw, 340px);
  height: auto;
  transform-origin: top center;
  animation: pendulum 3.4s ease-in-out infinite;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.18));
  will-change: transform;
}
@keyframes pendulum {
  0% {
    transform: rotate(-13deg);
  }
  50% {
    transform: rotate(13deg);
  }
  100% {
    transform: rotate(-13deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art img {
    animation: none;
  }
}

.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    filter 0.15s ease,
    transform 0.05s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  box-shadow: var(--shadow);
}
.btn-primary:hover {
  text-decoration: none;
  filter: brightness(1.05);
}
.btn svg {
  width: 20px;
  height: 20px;
}
.detect-note {
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
  margin: 0;
}
.subtle-links {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}
.subtle-links a {
  margin: 0 8px;
}

/* Download cards */
.downloads {
  padding: 24px 0 8px;
}
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.dl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.dl-card h3 {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}
.dl-card p {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 14px;
}
.btn-secondary {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  width: 100%;
}
.btn-secondary:hover {
  text-decoration: none;
  border-color: var(--accent);
}

/* Sections */
section.block {
  padding: 56px 0;
}
.section-title {
  text-align: center;
  font-size: clamp(26px, 4vw, 36px);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 36px;
  max-width: 620px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.feature .ic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 700;
}
.feature h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.note-banner {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text);
  font-size: 14px;
  text-align: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

/* Legal / prose pages (terms, privacy) */
.legal {
  width: min(760px, 92vw);
  margin: 0 auto;
  padding: 48px 0 24px;
}
.legal h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.legal .updated {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 14px;
}
.legal h2 {
  font-size: 20px;
  margin: 30px 0 8px;
}
.legal p {
  margin: 0 0 12px;
}
.legal ul {
  margin: 0 0 12px;
  padding-left: 22px;
}
.legal li {
  margin: 0 0 8px;
}
.legal a {
  text-decoration: underline;
}
.legal .muted {
  color: var(--muted);
}

@media (max-width: 560px) {
  .theme-toggle button span {
    display: none;
  }
}
