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

/* === Design Tokens === */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #222;
  --text: #e0e0e0;
  --text-secondary: #888;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --success: #22c55e;
  --danger: #ef4444;
  --code-text: #d4d4d4;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace;
  --max-width: 880px;
  --nav-height: 56px;
}

/* === Base === */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

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

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

code, pre {
  font-family: var(--font-mono);
}

/* === Skip Link (a11y) === */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  z-index: 200;
  font-size: 14px;
}
.skip-link:focus {
  top: 0;
}

/* === Nav === */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  transition: background 0.2s, backdrop-filter 0.2s;
}
nav.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.nav-logo span {
  color: var(--accent);
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-links a.active {
  color: var(--text);
}
.nav-links a.nav-cta {
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a.nav-cta:hover {
  background: var(--accent);
  color: var(--bg);
}

/* === Sections === */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 32px;
}

/* === Terminal === */
.term {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.term-header {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.term-dot.red { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green { background: #28c840; }
.term-body {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--code-text);
  overflow-x: auto;
  white-space: pre;
  text-align: left;
}

/* === Code Blocks === */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 72px 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--code-text);
  position: relative;
  white-space: pre;
  text-align: left;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-mono);
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}
.copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
}

/* === Footer === */
footer {
  text-align: center;
  padding: 64px 24px 48px;
  color: var(--text-secondary);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.footer-logo {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 16px;
}
footer p + p {
  margin-top: 8px;
}
.footer-links {
  margin-top: 16px;
}
.footer-links a {
  color: var(--text-secondary);
  margin: 0 12px;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--text);
}

/* === Utilities === */
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mono { font-family: var(--font-mono); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mt-48 { margin-top: 48px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 18px; }

/* === Responsive Base === */
@media (max-width: 480px) {
  .nav-links { gap: 16px; }
  .term-body { font-size: 11px; padding: 16px; }
  .code-block { padding-right: 24px; }
  .copy-btn { position: static; margin-top: 12px; display: inline-block; }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
