:root {
  --bg: #000;
  --surface: #0f1115;
  --surface-2: #181b22;
  --line: rgba(255, 255, 255, .08);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #6e6e73;
  --blue: #6f9bff;
  --orange: #ff8a1f;
  --win: #35c46f;
  --grad: linear-gradient(100deg, #6f9bff 0%, #b98cff 45%, #ff8a1f 100%);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* iOS ignores overflow on body alone; clip keeps the page from wiggling sideways. */
html, body { overflow-x: clip; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif; letter-spacing: -.025em; }
small { display: block; color: var(--muted); font-size: .8em; }
.center { text-align: center; }
.nw { white-space: nowrap; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- reveal on scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(36px) scale(.985);
  filter: blur(6px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease), filter 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---- nav ---- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 max(16px, calc((100vw - 1040px) / 2));
  background: rgba(0, 0, 0, .6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.brand img { border-radius: 7px; }
.nav nav { display: flex; gap: 22px; font-size: 13px; color: var(--muted); }
.nav nav a { transition: color .2s; }
.nav nav a:hover { color: var(--text); }

/* ---- hero ---- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 110px 16px 40px;
  background: radial-gradient(60% 50% at 50% 20%, rgba(111, 155, 255, .16), transparent 70%);
}
.hero-logo { border-radius: 26px; box-shadow: 0 20px 80px rgba(111, 155, 255, .25); margin-bottom: 34px; }
.hero h1 { font-size: clamp(34px, 6.4vw, 72px); line-height: 1.06; font-weight: 700; max-width: 980px; }
.lead { color: var(--muted); font-size: clamp(18px, 2.2vw, 22px); max-width: 640px; margin: 24px auto 0; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 13px 26px; border-radius: 980px; font-size: 17px; font-weight: 500;
  transition: transform .3s var(--ease), background .2s, box-shadow .3s;
}
.btn.primary { background: var(--text); color: #000; }
.btn.primary:hover { transform: scale(1.04); box-shadow: 0 8px 40px rgba(255, 255, 255, .18); }
.btn.ghost { color: var(--blue); }
.btn.ghost:hover { text-decoration: underline; }
.meta { margin-top: 22px; color: var(--faint); font-size: 14px; }

/* ---- app window (a real screenshot) ---- */
.stage { padding: 0 16px 120px; display: flex; justify-content: center; perspective: 1400px; }
.window {
  width: min(420px, 100%);
  border-radius: 18px; overflow: hidden;
  background: #0f1115; border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 50px 120px rgba(0, 0, 0, .7), 0 30px 160px rgba(111, 155, 255, .16);
  transform-origin: 50% 0;
  will-change: transform;
}
.window img { display: block; width: 100%; height: auto; }

/* ---- features ---- */
.features { max-width: 1040px; margin: 0 auto; padding: 0 16px; display: grid; gap: 160px; }
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.feature.flip .copy { order: 2; }
.feature h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 700; margin-bottom: 16px; }
.feature:nth-child(1) h2 { color: var(--blue); }
.feature:nth-child(2) h2 { color: #b98cff; }
.feature:nth-child(3) h2 { color: #ff6fb1; }
.feature:nth-child(4) h2 { color: var(--orange); }
.feature p { color: var(--muted); font-size: 18px; }
.feature em { color: var(--text); font-style: normal; white-space: nowrap; }
.visual {
  aspect-ratio: 4 / 3; border-radius: 28px; overflow: hidden; position: relative;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}

.v-ranks { background: radial-gradient(70% 70% at 50% 40%, rgba(185, 140, 255, .2), transparent 70%), var(--surface); }
.rk {
  position: absolute; translate: -50% -50%; height: auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .55));
  animation: float 6s ease-in-out infinite;
}
.rk-1 { left: 50%; top: 47%; width: 36%; animation-duration: 7s; filter: drop-shadow(0 0 40px rgba(220, 120, 255, .35)) drop-shadow(0 12px 30px rgba(0, 0, 0, .6)); }
.rk-2 { left: 22%; top: 34%; width: 21%; animation-delay: -1s; }
.rk-3 { left: 78%; top: 34%; width: 21%; animation-delay: -2.5s; }
.rk-4 { left: 16%; top: 72%; width: 16%; animation-delay: -4s; }
.rk-5 { left: 84%; top: 72%; width: 16%; animation-delay: -3s; }
.rk-6 { left: 37%; top: 85%; width: 12%; animation-delay: -1.8s; }
.rk-7 { left: 63%; top: 85%; width: 12%; animation-delay: -5s; }
.rk-8 { left: 50%; top: 12%; width: 10%; animation-delay: -3.6s; }
@keyframes float { 50% { transform: translateY(-10px); } }

.v-graph { flex-direction: column; padding: 30px; gap: 20px;
  background: radial-gradient(80% 80% at 70% 20%, rgba(185, 140, 255, .18), transparent 70%), var(--surface); }
.v-graph svg { width: 100%; height: 55%; overflow: visible; }
.v-graph .line {
  fill: none; stroke: #b98cff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  transition: stroke-dashoffset 2.2s var(--ease) .3s;
}
.v-graph.in .line { stroke-dashoffset: 0; }
.stats { display: flex; gap: 28px; }
.stats b { font-size: 26px; display: block; }

.v-music { flex-direction: column; gap: 6px; text-align: center;
  background: radial-gradient(80% 80% at 50% 30%, rgba(255, 111, 177, .18), transparent 70%), var(--surface); }
.v-music b { font-size: 22px; margin-top: 18px; }
.eq { display: flex; gap: 8px; align-items: flex-end; height: 90px; }
.eq i { width: 14px; border-radius: 7px; background: linear-gradient(#ff6fb1, #ff8a1f); animation: eq 1.2s ease-in-out infinite; }
.eq i:nth-child(1) { animation-delay: -.2s; }
.eq i:nth-child(2) { animation-delay: -.7s; }
.eq i:nth-child(3) { animation-delay: -.4s; }
.eq i:nth-child(4) { animation-delay: -.9s; }
.eq i:nth-child(5) { animation-delay: -.1s; }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }

.v-overlay { background: linear-gradient(160deg, #1b2a4a, #0b0d12 60%, #3a2210); }
.v-overlay::before { content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(40% 30% at 30% 70%, rgba(255, 138, 31, .25), transparent 70%),
    radial-gradient(30% 25% at 20% 30%, rgba(111, 155, 255, .25), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 60px, rgba(255, 255, 255, .03) 60px 61px); }
.v-overlay .pane {
  position: absolute; right: 7%; top: 8%; width: 34%; height: auto;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  animation: pop 7s var(--ease) infinite;
}
@keyframes pop {
  0%, 4% { opacity: 0; transform: translateX(30px) scale(.96); }
  14%, 84% { opacity: 1; transform: none; }
  94%, 100% { opacity: 0; transform: translateX(30px) scale(.96); }
}

/* ---- grid ---- */
.grid-wrap { max-width: 1040px; margin: 0 auto; padding: 200px 16px 0; }
.grid-wrap h2 { font-size: clamp(36px, 6vw, 64px); margin-bottom: 48px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cell { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; transition: transform .5s var(--ease), border-color .3s, opacity 1s var(--ease), filter 1s var(--ease); }
.cell:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, .16); }
.cell.wide { grid-column: span 2; background: linear-gradient(135deg, rgba(111, 155, 255, .12), rgba(255, 138, 31, .08)), var(--surface); }
.cell h3 { font-size: 21px; margin-bottom: 8px; }
.cell p { color: var(--muted); font-size: 15px; }

/* Marks features that change game files. */
.tag {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 3px 9px; border-radius: 980px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  color: var(--orange); background: rgba(255, 138, 31, .12); border: 1px solid rgba(255, 138, 31, .3);
}

.cell .why { margin-top: 10px; font-size: 13px; color: #c99a6e; }
.cell .why a { color: var(--orange); text-decoration: underline; text-underline-offset: 2px; }

/* ---- FAQ ---- */
.faq { max-width: 820px; margin: 0 auto; padding: 200px 16px 0; }
.faq h2 { font-size: clamp(36px, 6vw, 64px); margin-bottom: 40px; }
.qa { border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 4px; font-size: clamp(18px, 2.2vw, 21px); font-weight: 600;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; flex: none; font-size: 24px; font-weight: 300; color: var(--muted);
  transition: transform .3s var(--ease);
}
.qa details[open] summary::after { transform: rotate(45deg); }
.qa details p { color: var(--muted); padding: 0 4px 18px; }
.qa details p + p { margin-top: -6px; }
.qa code { font: 15px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---- download ---- */
.download { padding: 200px 16px 140px; text-align: center; }
.download h2 { font-size: clamp(40px, 7vw, 80px); }
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; gap: 16px; margin-top: 56px; }
.dl-card {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px;
  padding: 26px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line);
  transition: transform .4s var(--ease), border-color .3s, background .3s, opacity 1s var(--ease), filter 1s var(--ease);
}
.dl-card:hover { transform: translateY(-4px) scale(1.01); border-color: rgba(111, 155, 255, .5); background: var(--surface-2); }
.dl-card b { font-size: 13px; color: var(--muted); font-weight: 500; }
.dl-card span { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.dl-card.suggested { border-color: rgba(111, 155, 255, .6); box-shadow: 0 0 0 1px rgba(111, 155, 255, .3), 0 20px 60px rgba(111, 155, 255, .12); }
.fine { color: var(--faint); font-size: 13px; margin-top: 28px; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--line); padding: 28px max(16px, calc((100vw - 1040px) / 2)); color: var(--faint); font-size: 12px; display: grid; gap: 10px; }
footer div { display: flex; align-items: center; gap: 10px; color: var(--muted); }
footer img { border-radius: 5px; }
footer a:hover { color: var(--text); }

/* ---- small screens ---- */
@media (max-width: 760px) {
  .nav nav { gap: 16px; }
  .hero { padding-top: 92px; }
  .hero-logo { width: 88px; height: 88px; border-radius: 22px; margin-bottom: 26px; }
  .stage { padding-bottom: 72px; }
  .features { gap: 88px; }
  .feature { grid-template-columns: 1fr; gap: 26px; }
  .feature.flip .copy { order: 0; }
  .visual { border-radius: 22px; }
  /* The overlay has to stay readable on a narrow card. */
  .v-overlay .pane { width: 46%; right: 6%; top: 6%; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .cell { padding: 22px; border-radius: 20px; }
  .cell.wide { grid-column: auto; }
  .grid-wrap, .faq { padding-top: 110px; }
  .grid-wrap h2 { margin-bottom: 32px; }
  .download { padding: 110px 16px 90px; }
  .download h2 { font-size: clamp(32px, 9.5vw, 80px); }
  .dl { grid-template-columns: 1fr; margin-top: 40px; gap: 12px; }
  /* Animated blur is costly on phones; slide and fade only. */
  .reveal { filter: none; transition: opacity .9s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .rk, .eq i, .v-overlay .pane { animation: none; }
  .v-graph .line { stroke-dashoffset: 0; transition: none; }
}
