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

:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --bg-code: #282c34;
  --bg-terminal: #0d1117;
  --border: #e1e4e8;
  --text: #1a1a2e;
  --text-muted: #57606a;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --success: #16a34a;
  --error: #dc2626;
  --radius: 8px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-alt: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #4ade80;
    --accent-hover: #86efac;
    --success: #3fb950;
    --error: #f85149;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

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

a:hover {
  text-decoration: underline;
}

a[target="_blank"]:not(.btn):not(.nav-logo)::after {
  content: '';
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.2em;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='black' d='M3.5 1a.5.5 0 000 1H8.3L1.15 9.15a.5.5 0 00.7.71L9 2.7V7.5a.5.5 0 001 0v-6a.5.5 0 00-.5-.5H3.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='black' d='M3.5 1a.5.5 0 000 1H8.3L1.15 9.15a.5.5 0 00.7.71L9 2.7V7.5a.5.5 0 001 0v-6a.5.5 0 00-.5-.5H3.5z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  opacity: 0.7;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-logo img {
  width: auto;
  height: 36px;
  object-fit: contain;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

nav ul a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

nav ul a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  text-align: center;
  padding: 80px 24px 64px;
}

.hero-logo {
  width: 260px;
  max-width: 80%;
  object-fit: contain;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.terminal {
  display: inline-block;
  text-align: left;
  background: var(--bg-terminal);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
  min-width: 380px;
  max-width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.terminal-bar {
  background: #21262d;
  padding: 10px 14px;
  display: flex;
  gap: 7px;
}

.terminal-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #30363d;
}

.terminal-bar span:nth-child(1) { background: #f85149; }
.terminal-bar span:nth-child(2) { background: #e3b341; }
.terminal-bar span:nth-child(3) { background: #3fb950; }

.terminal pre {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #e6edf3;
  background: transparent;
  border: none;
}

.terminal code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.terminal .dim { color: #8b949e; }
.terminal .error { color: #f85149; }
.terminal .success { color: #3fb950; }

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

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
}

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  text-decoration: none;
}

/* Features */
.features {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px;
}

.features-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Docs */
.docs {
  padding: 64px 0;
}

.docs h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-top: 24px;
}

.docs h2:first-child {
  margin-top: 0;
}

.docs p {
  margin-bottom: 16px;
  color: var(--text-muted);
}

/* Code blocks */
.code-block {
  position: relative;
  margin: 16px 0;
}

.code-block pre {
  background: var(--bg-code);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.code-block pre:has(code.lang-bash) {
  padding-left: 3em;
  position: relative;
}

.code-block pre:has(code.lang-bash)::before {
  content: '$';
  position: absolute;
  left: 1.2em;
  top: 20px;
  color: #8b949e;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  user-select: none;
  pointer-events: none;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: transparent !important;
  border: none;
  padding: 0 !important;
  line-height: 1.7;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #30363d;
  color: #8b949e;
  border: none;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: #484f58;
  color: #e6edf3;
}

.copy-btn.copied {
  color: #3fb950;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.9rem;
}

th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}

tr:nth-child(even) td {
  background: var(--bg-alt);
}

/* Security */
.security-section {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 64px 0;
}

.security-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.security-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 32px 0 16px;
}

.security-section ul {
  list-style: none;
  margin-bottom: 24px;
}

.security-section ul li {
  padding: 6px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.security-section ul li::before {
  content: '✓ ';
  color: var(--success);
  font-weight: 600;
}

.security-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer p + p {
  margin-top: 8px;
}

.footer-cta {
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .terminal { min-width: unset; width: 100%; }
  nav ul { gap: 16px; }
}
