:root {
  --bg: #111111;
  --panel: #181818;
  --panel-hover: #1f1f1f;
  --border: #2a2a2a;
  --text: #e6e6e6;
  --dim: #8a8a8a;
  --accent: #5b8def;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

main, footer {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #7ea6f3; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

code, kbd {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  font: 0.9em var(--mono);
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- GitHub link (top right) ---- */
.repo-link {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  display: flex;
  padding: 6px;
  border-radius: 50%;
  color: var(--dim);
  transition: color 0.15s;
}

.repo-link:hover { color: var(--accent); }

/* ---- hero ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 0 40px;
  text-align: center;
}

.logo { width: 96px; height: 96px; }

h1 {
  margin: 20px 0 6px;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0 0 32px;
  color: #a0a0a0;
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
}

.download {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: min(100%, 300px);
  padding: 16px 32px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(91, 141, 239, 0.25);
  transition: background-color 0.15s, transform 0.15s;
}

.download:hover { background: #6d9af1; color: #ffffff; transform: translateY(-1px); }
.download:active { transform: none; }
.download:focus-visible { outline-color: #ffffff; border-radius: 12px; }

.download-label { font-size: 1.25rem; font-weight: 600; }
.download-detail { font-size: 0.875rem; opacity: 0.85; }

.others { margin: 16px 0 0; color: var(--dim); }

.meta {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 0.875rem;
}

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

/* ---- demo ---- */
.demo-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #000000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.demo-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.demo-note {
  margin: 12px 0 0;
  color: var(--dim);
  font-size: 0.875rem;
  text-align: center;
}

/* ---- features ---- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 56px 0;
}

.features article {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.features h2 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 600; }
.features p { margin: 0; color: #bdbdbd; }

/* ---- first launch help ---- */
.help { max-width: 720px; margin: 0 auto 56px; }
.help > h2 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 600; }
.help > p { color: #bdbdbd; }

details {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

summary {
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

summary:hover { background: var(--panel-hover); }
details[open] summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }

details ol { margin: 16px 0; padding: 0 20px 0 44px; }
details li { margin: 6px 0; }
.tip { margin: 0; padding: 0 20px 16px; color: var(--dim); font-size: 0.9rem; }

/* ---- footer ---- */
footer {
  padding: 28px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 0.875rem;
  text-align: center;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

footer a { color: var(--text); }
footer a:hover { color: var(--accent); }
footer p { margin: 16px 0 0; }

@media (max-width: 480px) {
  .hero { padding-top: 48px; }
  .download { padding: 14px 20px; }
  .features { margin: 40px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .download { transition: none; }
  .download:hover { transform: none; }
}

/* ---- not found (404.html) ---- */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 0;
  text-align: center;
}

.not-found .code {
  margin: 20px 0 0;
  color: var(--accent);
  font: 600 0.95rem var(--mono);
  letter-spacing: 0.2em;
}

.not-found h1 { margin-top: 4px; }
