/* PicoClaw website - Design System */
:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-muted: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #3fb950;
  --accent-dim: #238636;
  --accent-glow: rgba(63, 185, 80, 0.15);
  --cyan: #58a6ff;
  --orange: #d29922;
  --red: #f85149;
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  --max-width: 960px;
  --nav-height: 56px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* Skip link for a11y & SEO */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--bg);
  z-index: 100;
  border-radius: var(--radius);
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0.5rem;
  left: 0.5rem;
}

/* Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.site-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.nav-links a:hover { color: var(--text); background: var(--bg-muted); }

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 2rem;
  margin-bottom: 3rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 24px var(--accent-glow);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { background: #46c35a; }

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

/* Sections */
.section {
  margin: 3rem 0;
}

.section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section h3 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.section h4 { font-size: 1.1rem; margin: 1rem 0 0.5rem; color: var(--text-muted); }
.section .muted { color: var(--text-muted); font-size: 0.9375rem; margin-top: 0.75rem; }
.section .muted a { color: var(--text-muted); text-decoration: underline; }
.section .muted a:hover { color: var(--text); }

/* Cards / comparison table */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.card h3 { margin-top: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1rem 0;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
}

th {
  background: var(--bg-muted);
  font-weight: 600;
}

tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* Code */
pre, code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}

code {
  background: var(--bg-muted);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre code { background: none; padding: 0; }

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border-left: 4px solid;
}

.alert-warning {
  background: rgba(210, 153, 34, 0.1);
  border-color: var(--orange);
  color: var(--text);
}

.alert-info {
  background: rgba(88, 166, 255, 0.1);
  border-color: var(--cyan);
}

.alert-danger {
  background: rgba(248, 81, 73, 0.1);
  border-color: var(--red);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  background: var(--bg-elevated);
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.footer-links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }

/* Page title (inner pages) */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--cyan); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Docs sidebar layout */
.docs-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { order: 2; }
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  height: fit-content;
}

.docs-sidebar nav {
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.docs-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-sidebar li { margin: 0.25rem 0; }
.docs-sidebar a {
  display: block;
  padding: 0.35rem 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.docs-sidebar a:hover, .docs-sidebar a[aria-current="page"] { color: var(--accent); }

/* Lists */
ul.feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
ul.feature-list li {
  padding: 0.35rem 0;
  padding-left: 1.5rem;
  position: relative;
}
ul.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* Release badge */
.release-badge {
  display: inline-block;
  background: var(--accent-dim);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Security notice */
.security-notice {
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.security-notice strong { color: var(--red); }

/* Hamburger menu (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  flex-shrink: 0;
  transition: transform 0.2s, opacity 0.2s;
}
body.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
body.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav { position: relative; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0.5rem;
    margin: 0 -1.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  body.nav-open .nav-links {
    display: flex;
  }
  .nav-links li { margin: 0; }
  .nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
  }

  main { padding: 1.5rem 1rem 3rem; }
  .hero { padding: 2rem 1rem; margin-bottom: 2rem; }
  .hero .tagline { font-size: 1.1rem; }
  .hero-cta { flex-direction: column; align-items: center; }

  .card-grid { grid-template-columns: 1fr; }
  .section .muted { font-size: 0.875rem; }

  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 0.5rem 0.75rem; font-size: 0.875rem; }

  .site-footer-inner { flex-direction: column; align-items: flex-start; text-align: left; }
  .footer-links { flex-wrap: wrap; gap: 0.75rem; }
}
