:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #111827;
    --border: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --primary-light: #1e293b;
  }
}

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

html {
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 0.95rem;
}

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn img,
.btn svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.btn:hover {
  text-decoration: none;
  opacity: 0.92;
}

.btn-primary {
  background: var(--primary);
  color: #fff !important;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 30px;
}

.badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Interactive Demo Box */
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 30px 0 50px;
  overflow: hidden;
}

.demo-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-canvas-wrapper {
  position: relative;
  height: 240px;
  cursor: crosshair;
  background: var(--bg);
  user-select: none;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.demo-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.95rem;
  text-align: center;
}

.demo-status {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.demo-status.active {
  opacity: 1;
}

/* Grid & Cards */
.section {
  padding: 30px 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Gestures table */
.gestures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.gesture-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.gesture-icon {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  width: 28px;
  text-align: center;
}

.gesture-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.gesture-stroke {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--mono);
}



code {
  font-family: var(--mono);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--text);
}

/* Simple Document / Legal text */
.doc-shell {
  padding: 40px 0 60px;
}

.doc-shell h1 {
  margin-bottom: 8px;
}

.doc-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.doc-shell h2 {
  margin: 28px 0 10px;
  font-size: 1.25rem;
}

.doc-shell p, .doc-shell ul {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.doc-shell ul {
  padding-left: 20px;
}

.doc-shell li {
  margin-bottom: 6px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  margin-top: 50px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }
  .nav-links {
    display: none;
  }
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
