:root {
  --bg: #07080a;
  --bg-elevated: #0e1014;
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f5f7;
  --text-muted: rgba(244, 245, 247, 0.55);
  --text-dim: rgba(244, 245, 247, 0.35);
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --accent-glow: rgba(0, 212, 255, 0.25);
  --chart-1: #00d4ff;
  --chart-2: #a78bfa;
  --chart-3: #4ade80;
  --chart-4: rgba(255, 255, 255, 0.18);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

body { display: flex; flex-direction: column; }

html { scroll-behavior: smooth; }

.m-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(0, 212, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(120, 80, 255, 0.05), transparent 55%),
    var(--bg);
  animation: bgDrift 28s ease-in-out infinite alternate;
}

@keyframes bgDrift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-3%, 2%, 0); }
}

.m-app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100dvh;
}

/* ============ TOP ============ */

.m-top {
  max-width: 460px;
  margin: 0 auto;
  padding:
    calc(28px + env(safe-area-inset-top, 0px))
    28px
    28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: fadeUp 700ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* notice pill */

.m-notice {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke);
  border-radius: 999px;
}

.m-notice svg { color: var(--accent); flex-shrink: 0; }

/* brand: small MOYU wordmark + intro line */

.m-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.m-logo {
  font-size: clamp(32px, 7.5vw, 48px);
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  padding-left: 0.16em;
  color: var(--text);
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.72) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.m-intro {
  font-size: clamp(14px, 3.2vw, 16px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  max-width: 36ch;
  font-style: italic;
}

/* install stack — install + manual */

.m-install-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============ REVEAL TRIGGER ============ */

.m-reveal {
  align-self: center;
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  transition: color 200ms ease;
}

.m-reveal:hover,
.m-reveal:focus-visible { color: var(--text); outline: none; }

.m-reveal-text {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.m-reveal-arrow {
  display: inline-flex;
  color: currentColor;
  animation: bounce 2.4s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(6px); opacity: 1; }
}

.m-app.is-open .m-reveal {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin: 0;
  padding: 0;
  transition: opacity 300ms ease,
              height 400ms ease 100ms,
              margin 400ms ease 100ms,
              padding 400ms ease 100ms;
  overflow: hidden;
}

/* ============ REVEAL CONTENT ============ */

.m-reveal-wrap {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 700ms cubic-bezier(.2, .8, .2, 1),
              opacity 500ms ease 100ms;
}

.m-app.is-open .m-reveal-wrap {
  max-height: 8000px;
  opacity: 1;
}

.m-reveal-inner {
  max-width: 460px;
  margin: 0 auto;
  padding: 0 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 44px;
  transform: translateY(16px);
  transition: transform 600ms cubic-bezier(.2, .8, .2, 1) 80ms;
}

.m-app.is-open .m-reveal-inner { transform: translateY(0); }

/* ============ BLOCKS ============ */

.m-block { display: flex; flex-direction: column; }

.m-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.m-block-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.3;
}

.m-block-sub {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.m-trusted {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-style: italic;
}

.m-divider {
  border: none;
  height: 1px;
  background: var(--stroke);
}

/* ============ QR / INSTALL ============ */

.m-qr-wrap {
  margin-top: 20px;
  align-self: center;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 48px var(--accent-glow);
}

.m-qr-wrap img {
  display: block;
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
}

.m-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.m-url {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.4;
}

.m-url-block {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  text-align: center;
}

.m-copy {
  flex-shrink: 0;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px solid var(--stroke-strong);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 120ms ease, transform 80ms ease, border-color 120ms ease;
}

.m-copy:hover { background: var(--accent-dim); border-color: rgba(0, 212, 255, 0.35); }
.m-copy:active { transform: scale(0.97); }
.m-copy.copied {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.10);
}

.m-primary-btn {
  display: block;
  margin-top: 18px;
  background: linear-gradient(135deg, #00b8e6 0%, #00d4ff 50%, #33ddff 100%);
  color: #041018;
  text-decoration: none;
  text-align: center;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 32px var(--accent-glow);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.m-primary-btn:active { transform: scale(0.98); box-shadow: 0 4px 16px var(--accent-glow); }

/* ============ STATS GRID ============ */

.m-stats-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 24px;
}

.m-stat { display: flex; flex-direction: column; gap: 4px; }

.m-stat-num {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.m-stat-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.m-stat-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* ============ DONUT ============ */

.m-donut-wrap {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.m-donut {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.m-donut-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    var(--chart-1) 0%   41%,
    var(--chart-2) 41%  73%,
    var(--chart-3) 73%  91%,
    var(--chart-4) 91% 100%
  );
  filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.15));
}

.m-donut-center {
  position: absolute;
  inset: 24px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.m-donut-pct {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.m-donut-cap {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.m-legend {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-legend li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
}

.m-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.m-swatch.s1 { background: var(--chart-1); }
.m-swatch.s2 { background: var(--chart-2); }
.m-swatch.s3 { background: var(--chart-3); }
.m-swatch.s4 { background: var(--chart-4); }

.m-leg-label { color: var(--text-muted); }
.m-leg-pct {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

/* ============ BARS ============ */

.m-bars {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.m-bar-set { display: flex; flex-direction: column; gap: 6px; }

.m-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.m-bar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.m-bar-delta {
  font-family: var(--mono);
  font-size: 11px;
  color: #4ade80;
  font-weight: 600;
}

.m-bar {
  display: grid;
  grid-template-columns: 56px 1fr 44px;
  align-items: center;
  gap: 10px;
}

.m-bar-tag {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.m-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.m-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width 1200ms cubic-bezier(.22, 1, .36, 1) 350ms;
}

.m-bar-fill.before { background: rgba(255, 255, 255, 0.22); }
.m-bar-fill.after {
  background: linear-gradient(90deg, var(--chart-1) 0%, #33ddff 100%);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.m-app.is-open .m-bar-fill { width: var(--w); }

.m-bar-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  text-align: right;
}

/* ============ TABLE ============ */

.m-table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.m-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.m-table th,
.m-table td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid var(--stroke);
}

.m-table tr:last-child td { border-bottom: none; }

.m-table thead th {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.m-table thead th.hi { color: var(--accent); }

.m-table tbody td:first-child {
  text-align: left;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.m-table tbody td.hi {
  color: var(--accent);
  font-weight: 700;
  background: rgba(0, 212, 255, 0.04);
}

/* ============ QUOTES ============ */

.m-quotes {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.m-quote-card {
  padding: 22px 22px 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--stroke);
  border-radius: 16px;
}

.m-quote {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
  font-weight: 400;
}

.m-quote-attr {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ============ MANUAL STEPS ============ */

.m-steps {
  margin-top: 18px;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

.m-steps li { padding-left: 4px; }
.m-steps strong { color: var(--text); font-weight: 600; }

.m-steps code {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
}

/* ============ FINE PRINT ============ */

.m-fineprint {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px dashed var(--stroke);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-dim);
  font-style: italic;
}

/* ============ FOOTER ============ */

.m-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 24px calc(28px + env(safe-area-inset-bottom, 0px));
}

.m-gh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--stroke);
  transition: color 120ms ease, border-color 120ms ease;
}

.m-gh:hover,
.m-gh:focus-visible {
  color: var(--text);
  border-color: var(--stroke-strong);
  outline: none;
}

.m-credit {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ============ MOBILE ============ */

@media (max-width: 720px) {
  .desktop-only { display: none !important; }
  .m-stat-num { font-size: 36px; }
}

/* ============ DESKTOP ============ */

@media (min-width: 721px) {
  .mobile-only { display: none !important; }

  /* Top section vertically fills the viewport so the footer sits at the
     bottom edge rather than floating in the middle of a wide screen. */
  .m-top {
    flex: 1;
    max-width: 920px;
    padding: 48px 40px 32px;
    gap: 32px;
    justify-content: center;
  }

  .m-brand { gap: 16px; }
  .m-logo {
    font-size: clamp(48px, 6vw, 68px);
    letter-spacing: 0.14em;
    padding-left: 0.14em;
  }
  .m-intro {
    font-size: 17px;
    max-width: 40ch;
  }

  /* Install and Manual sit side-by-side as equally-sized cards. */
  .m-install-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
    padding: 0;
    background: transparent;
    border: none;
    backdrop-filter: none;
  }

  .m-install-stack > .m-divider { display: none; }

  .m-install-stack > .m-block {
    display: flex;
    flex-direction: column;
    padding: 28px 28px 26px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    backdrop-filter: blur(20px);
  }

  .m-reveal { margin-top: 0; }

  .m-footer { padding: 16px 40px 24px; }

  /* Reveal content: wider container, multi-column where it makes sense. */
  .m-reveal-inner {
    max-width: 880px;
    padding: 0 56px 64px;
    gap: 64px;
  }

  .m-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }

  .m-donut-wrap {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 56px;
  }

  .m-legend { flex: 1; max-width: 380px; }

  .m-quotes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .m-bars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-top,
  .m-reveal-arrow,
  .m-bg { animation: none; }
  .m-reveal-wrap,
  .m-reveal-inner,
  .m-bar-fill,
  .m-reveal { transition: none; }
  html { scroll-behavior: auto; }
  .m-app.is-open .m-bar-fill { width: var(--w); }
}
