:root {
  --ink: #0C0D10;
  --panel: #14161B;
  --line: rgba(233, 235, 240, 0.09);
  --line-strong: rgba(233, 235, 240, 0.17);
  --text: #E9EBF0;
  --text-soft: #C5CAD4;
  --muted: #98A0AE;
  --accent: #5B8CF7;
  --accent-bright: #7AA2FA;
  --focus: #9DB8FF;
  --danger: #F0A39C;
  --sans: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 50% -220px, rgba(91, 140, 247, 0.10), transparent 70%),
    var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(91, 140, 247, 0.35);
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #06122B;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}

.shell-wide {
  max-width: 1240px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(12, 13, 16, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
}

.nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover {
  color: var(--text);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #06122B;
}

.btn-primary:hover {
  background: var(--accent-bright);
}

.btn-small {
  height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 13px;
}

.link-quiet {
  display: inline-block;
  font-size: 15px;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text-soft);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.link-quiet:hover {
  color: var(--text);
  border-color: var(--text);
}

/* Hero */

.hero {
  padding-block: clamp(64px, 9vw, 112px) clamp(56px, 8vw, 96px);
}

.hero-name {
  margin: 0;
  font-size: clamp(3.25rem, 9vw, 5.75rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.hero-line {
  margin: 20px 0 0;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.005em;
}

.hero-copy {
  max-width: 54ch;
  margin: 20px 0 0;
  font-size: 1.0625rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
}

.hero-meta {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* Demo viewer */

.demo {
  margin: clamp(44px, 6vw, 64px) 0 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #0A0B0E;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 40px 80px -40px rgba(0, 0, 0, 0.85);
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #0E1014;
}

.demo-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.demo-brand svg {
  width: 18px;
  height: 18px;
}

.demo-file {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-tag {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid rgba(91, 140, 247, 0.35);
  border-radius: 999px;
  background: rgba(91, 140, 247, 0.08);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.demo-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05070B;
}

.demo-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.demo-spec {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: rgba(5, 7, 11, 0.55);
  color: rgba(233, 235, 240, 0.62);
  font-family: var(--mono);
  font-size: 11px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.demo-controls {
  padding: 16px 18px 14px;
  border-top: 1px solid var(--line);
  background: #0E1014;
}

/* Range input */

.scrub {
  --fill: 0%;
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.scrub::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 8px),
    linear-gradient(90deg, var(--accent) var(--fill), rgba(255, 255, 255, 0.12) var(--fill));
  background-repeat: no-repeat;
  background-size: 100% 4px;
}

.scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid #0E1014;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(91, 140, 247, 0.6), 0 0 12px rgba(91, 140, 247, 0.35);
}

.scrub::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.scrub::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}

.scrub::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #0E1014;
  border-radius: 50%;
  background: var(--accent);
}

.scrub:focus-visible {
  outline-offset: 6px;
}

.demo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.tc {
  font-family: var(--mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.frame-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.spacer {
  flex: 1;
}

.step {
  width: 40px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.step:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
}

.demo-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.demo-status.is-alert {
  color: var(--danger);
}

/* Sections */

.section {
  padding-block: clamp(64px, 9vw, 104px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}

.section h2 {
  margin: 0 0 clamp(32px, 5vw, 48px);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section h2 + .section-lead {
  margin-top: calc(12px - clamp(32px, 5vw, 48px));
  margin-bottom: clamp(28px, 4vw, 40px);
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding-top: 22px;
  border-top: 1px solid var(--line-strong);
}

.step-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.steps h3 {
  margin: 10px 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
}

.steps p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--muted);
}

/* Specs */

.specs {
  margin: 0;
  border-top: 1px solid var(--line-strong);
}

.spec {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.spec dt {
  font-size: 0.9375rem;
  font-weight: 600;
}

.spec dd {
  max-width: 62ch;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Download */

.download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(91, 140, 247, 0.10), rgba(91, 140, 247, 0) 55%),
    var(--panel);
}

.download-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.download-panel p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.download-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

/* Footer */

.site-footer {
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner nav {
  display: flex;
  gap: 20px;
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--text);
}

/* Responsive */

@media (max-width: 860px) {
  .nav {
    display: none;
  }

  .header-inner > .btn {
    margin-left: auto;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .spec {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .download-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-spec {
    display: none;
  }

  .tc {
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-inline: 18px;
  }

  .demo-strip {
    gap: 10px;
  }

  .demo-strip .spacer {
    display: none;
  }

  #save {
    margin-left: auto;
  }

  .frame-count {
    font-size: 11px;
  }

  .demo-controls {
    padding: 14px 14px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
