:root {
  color-scheme: dark;
  --bg: #070914;
  --bg-soft: #0d1021;
  --panel: rgba(18, 22, 42, 0.82);
  --panel-solid: #12162a;
  --panel-strong: #191f3a;
  --text: #f5f7ff;
  --muted: #9ea7c7;
  --line: rgba(166, 180, 255, 0.18);
  --violet: #8b5cf6;
  --violet-strong: #a855f7;
  --cyan: #22d3ee;
  --blue: #38bdf8;
  --green: #34d399;
  --amber: #f59e0b;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 12%, rgba(139, 92, 246, 0.3), transparent 32rem),
    radial-gradient(circle at 82% 8%, rgba(34, 211, 238, 0.18), transparent 30rem),
    radial-gradient(circle at 50% 42%, rgba(168, 85, 247, 0.14), transparent 34rem),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 30%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 118px,
      rgba(255, 255, 255, 0.025) 120px
    );
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

.spell-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 20, 0.72);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 0 26px rgba(139, 92, 246, 0.46);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

main {
  overflow: hidden;
}

.section-band,
.section-grid,
.simulator-section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  gap: clamp(34px, 6vw, 80px);
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: 84px 0 70px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 80px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
}

.hero-lead,
.section-heading p,
.download-card p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-lead {
  max-width: 720px;
}

.hero-actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  border-color: rgba(34, 211, 238, 0.58);
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 16px 48px rgba(34, 211, 238, 0.18);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.06);
}

.button.secondary {
  background: rgba(139, 92, 246, 0.16);
}

.button.compact {
  min-height: 38px;
  padding: 0 14px;
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(34, 211, 238, 0.1);
  color: #dffbff;
}

.button.wide {
  width: 100%;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
  margin: 34px 0 0;
}

.hero-stats div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px);
}

.hero-stats dt {
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 28px;
  font-weight: 900;
}

.hero-stats dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-visual {
  position: relative;
  min-height: 560px;
}

.halo-card {
  position: absolute;
  inset: 4% 6% auto auto;
  width: min(440px, 86vw);
  aspect-ratio: 1;
  border: 1px solid rgba(166, 180, 255, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 58%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03));
  box-shadow:
    inset 0 0 80px rgba(139, 92, 246, 0.18),
    0 36px 90px rgba(0, 0, 0, 0.5);
  animation: float-card 7s ease-in-out infinite;
}

.mascot {
  position: absolute;
  inset: 7%;
  width: 86%;
  height: 86%;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 16px 34px rgba(34, 211, 238, 0.28));
}

.rune-ring {
  position: absolute;
  inset: -16px;
  border: 1px dashed rgba(34, 211, 238, 0.4);
  border-radius: 50%;
  animation: rotate-ring 22s linear infinite;
}

.rune-ring span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--cyan);
  box-shadow: 0 0 22px var(--cyan);
}

.rune-ring span:nth-child(1) {
  top: 8%;
  left: 18%;
}

.rune-ring span:nth-child(2) {
  top: 28%;
  right: 1%;
  background: var(--violet);
}

.rune-ring span:nth-child(3) {
  right: 18%;
  bottom: 5%;
}

.rune-ring span:nth-child(4) {
  bottom: 26%;
  left: 0;
  background: var(--violet-strong);
}

.floating-note {
  position: absolute;
  z-index: 2;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 42, 0.78);
  box-shadow: var(--shadow);
  color: #eaf7ff;
  font-weight: 800;
  backdrop-filter: blur(18px);
  animation: drift 5.5s ease-in-out infinite;
}

.note-one {
  top: 12%;
  left: 0;
}

.note-two {
  right: 4%;
  bottom: 22%;
  animation-delay: 0.9s;
}

.note-three {
  bottom: 10%;
  left: 8%;
  animation-delay: 1.8s;
}

.product-strip {
  display: grid;
  grid-template-columns: minmax(240px, 420px) 1fr;
  gap: 28px;
  align-items: center;
  width: min(1040px, calc(100% - 36px));
  margin: -14px auto 96px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: var(--shadow);
}

.product-strip img {
  border-radius: 8px;
}

.product-strip p {
  margin-bottom: 8px;
  color: var(--cyan);
  font-weight: 800;
}

.product-strip strong {
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.2;
}

.section-grid,
.simulator-section {
  padding: 86px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.step-card,
.download-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
}

.feature-card {
  min-height: 230px;
  padding: 24px;
}

.feature-card span {
  display: inline-flex;
  margin-bottom: 26px;
  color: var(--cyan);
  font-weight: 900;
}

.feature-card p,
.step-card p {
  color: var(--muted);
  line-height: 1.7;
}

.workflow {
  padding: 88px 0;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.step-card {
  padding: 22px;
}

.step-card span {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  font-weight: 900;
}

.screenshot-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.screenshot-stage img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  box-shadow: var(--shadow);
}

.app-simulator {
  display: grid;
  grid-template-columns: 132px minmax(210px, 300px) minmax(420px, 1fr) minmax(220px, 280px);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(166, 180, 255, 0.24);
  border-radius: 8px;
  background: #171a20;
  box-shadow: var(--shadow);
}

.sim-sidebar,
.sim-tree,
.sim-workspace,
.sim-properties {
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-sidebar {
  padding: 86px 10px 16px;
  background: #101317;
}

.sim-main {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
}

.sim-main.active,
.sim-main:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.12);
  color: var(--text);
}

.sim-tree {
  padding: 18px 14px;
  background: #202226;
}

.sim-title {
  margin-bottom: 16px;
  font-weight: 900;
}

.tree-node,
.tree-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #dbe4f0;
  text-align: left;
  cursor: pointer;
}

.tree-node:hover,
.tree-node.active,
.tree-action:hover,
.tree-action.active {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 116, 144, 0.34);
}

.tree-node small,
.sim-topbar small,
.queue-status small,
.video-card small {
  display: block;
  color: #93a1b8;
}

.node-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: white;
  font-weight: 900;
}

.node-icon.purple {
  background: var(--violet);
}

.node-icon.green {
  background: #2fbf7a;
}

.node-icon.amber {
  background: #b7791f;
}

.tree-children {
  margin: 8px 0 0 42px;
}

.tree-action {
  padding: 9px 11px;
}

.sim-workspace {
  padding: 24px;
  background: #181a1f;
}

.sim-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.sim-topbar h3 {
  margin: 2px 0 0;
  font-size: 30px;
}

.spell-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.spell-step {
  min-height: 48px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  color: #dcfce7;
  cursor: pointer;
}

.spell-step::before {
  margin-right: 8px;
  content: "✓";
}

.spell-step.active {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.13);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.08);
}

.matting-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #202226;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

input,
select {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #121418;
  color: var(--text);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--violet);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

figure {
  min-width: 0;
  margin: 0;
}

figcaption {
  margin-bottom: 8px;
  color: #cbd5e1;
  font-weight: 800;
}

.sprite-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.green-bg {
  background:
    linear-gradient(90deg, #111827 0 23%, transparent 23% 77%, #111827 77%),
    #20d82b;
}

.transparent-bg {
  background-color: #25272d;
  background-image:
    linear-gradient(45deg, #1c1e24 25%, transparent 25%),
    linear-gradient(-45deg, #1c1e24 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1c1e24 75%),
    linear-gradient(-45deg, transparent 75%, #1c1e24 75%);
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  background-size: 24px 24px;
}

.sprite-character {
  display: block;
  width: min(72%, 190px);
  max-height: 82%;
  object-fit: contain;
  filter:
    drop-shadow(0 16px 28px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 var(--sprite-glow, 0px) rgba(34, 211, 238, 0.5));
  animation: sprite-run 0.82s steps(2) infinite;
}

.sim-properties {
  padding: 44px 16px 16px;
  background: #222428;
  border-right: 0;
}

.video-card {
  margin: 18px 0;
}

.video-screen {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-bottom: 8px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, #05070a 0 28%, #1ed429 28% 72%, #05070a 72%),
    #111827;
}

.video-screen .sprite-character {
  width: min(58%, 150px);
}

.queue-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.queue-status small {
  grid-column: 2;
}

#queueDot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #64748b;
}

.queue-status.running #queueDot {
  background: var(--cyan);
  box-shadow: 0 0 20px var(--cyan);
}

.queue-status.done #queueDot {
  background: var(--green);
  box-shadow: 0 0 20px var(--green);
}

.download {
  padding: 86px 0 110px;
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 5vw, 48px);
  background:
    radial-gradient(circle at 90% 12%, rgba(34, 211, 238, 0.22), transparent 24rem),
    linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(255, 255, 255, 0.04));
}

.download-card > div:first-child {
  max-width: 680px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

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

.spark {
  position: fixed;
  z-index: 40;
  width: 8px;
  height: 8px;
  pointer-events: none;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
  animation: spark-pop 650ms ease-out forwards;
}

@keyframes float-card {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -18px, 0);
  }
}

@keyframes rotate-ring {
  to {
    transform: rotate(360deg);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes sprite-run {
  0% {
    transform: translateX(-4px) scale(1);
  }
  100% {
    transform: translateX(4px) scale(1.04);
  }
}

@keyframes spark-pop {
  to {
    opacity: 0;
    transform: translate(var(--spark-x), var(--spark-y)) scale(0.2);
  }
}

@media (max-width: 1120px) {
  .hero,
  .product-strip,
  .screenshot-stage,
  .download-card {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 480px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-simulator {
    grid-template-columns: 112px minmax(210px, 260px) 1fr;
  }

  .sim-properties {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr minmax(180px, 260px);
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sim-properties h3 {
    display: none;
  }

  .video-card {
    margin: 0;
  }
}

@media (max-width: 780px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .hero-stats,
  .feature-grid,
  .workflow-steps,
  .app-simulator,
  .control-grid,
  .preview-grid,
  .sim-properties {
    grid-template-columns: 1fr;
  }

  .app-simulator {
    min-height: 0;
  }

  .sim-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .sim-main {
    margin-bottom: 0;
    text-align: center;
  }

  .sim-tree,
  .sim-workspace,
  .sim-properties {
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .spell-steps {
    grid-template-columns: 1fr;
  }

  .sim-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sprite-preview {
    min-height: 220px;
  }

  .download-card {
    display: block;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .section-band,
  .section-grid,
  .simulator-section,
  .product-strip {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding-top: 54px;
  }

  h1 {
    font-size: 38px;
  }

  .hero-visual {
    min-height: 390px;
  }

  .floating-note {
    font-size: 13px;
  }

  .halo-card {
    inset: 4% 0 auto auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
