/* === Variables === */
:root {
  --bg: #0d0d0f;
  --bg-alt: #111114;
  --bg-card: #16161a;
  --border: #2a2a30;
  --text: #e8e8ed;
  --text-muted: #8888a0;
  --accent: #e07b39;
  --accent-hover: #f08c4a;
  --accent-subtle: rgba(224, 123, 57, 0.12);
  --code-bg: #1a1a20;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f8fa;
    --bg-alt: #ffffff;
    --bg-card: #ffffff;
    --border: #e0e0e8;
    --text: #1a1a24;
    --text-muted: #666680;
    --accent: #c96a28;
    --accent-hover: #b05e22;
    --accent-subtle: rgba(201, 106, 40, 0.1);
    --code-bg: #f0f0f5;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.08);
  }
}

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

html { scroll-behavior: smooth; }

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

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

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

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

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

ul { list-style: none; }

/* === Layout === */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Header / Nav === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: light) {
  .header { background: rgba(248, 248, 250, 0.85); }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-github {
  background: var(--accent-subtle);
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s !important;
}

.nav-github:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 700px) {
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
    align-items: flex-start;
  }
  .nav-links.open { display: flex; }
}

/* === Hero === */
.hero {
  padding: 6rem 0 5rem;
  text-align: center;
  background: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(224,123,57,0.12) 0%, transparent 70%);
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-title span { color: var(--accent); }

.hero-tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

.hero-description em { color: var(--text); font-style: italic; }

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(224,123,57,0.35);
}

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

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

/* === Sections === */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
}

/* === Cards === */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* === Tables === */
.table-wrapper { overflow-x: auto; }

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.specs-table th,
.specs-table td {
  text-align: left;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.specs-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--bg-card);
}

.specs-table td:first-child { font-weight: 500; white-space: nowrap; }

.specs-table tbody tr:hover { background: var(--bg-card); }

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.badge-blue { background: rgba(56,130,246,0.15); color: #60a5fa; border: 1px solid rgba(56,130,246,0.3); }
.badge-green { background: rgba(52,199,89,0.15); color: #4ade80; border: 1px solid rgba(52,199,89,0.3); }
.badge-orange { background: rgba(224,123,57,0.15); color: #fb923c; border: 1px solid rgba(224,123,57,0.3); }
.badge-purple { background: rgba(175,82,222,0.15); color: #c084fc; border: 1px solid rgba(175,82,222,0.3); }

/* === HAL section === */
.hal-note {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: -0.5rem;
  margin-bottom: 2rem;
}

.subsection-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* === Steps === */
.steps { display: flex; flex-direction: column; gap: 2rem; }

.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 2px;
}

.step-content { flex: 1; min-width: 0; }

.step-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.step-content ul {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-left: 1rem;
}

.step-content ul li::before { content: "→ "; color: var(--accent); }

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

/* === Footer === */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  background: var(--bg-alt);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.footer-brand .nav-logo {
  display: inline-block;
  margin-bottom: 0.5rem;
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

/* === Highlight.js overrides === */
.hljs {
  background: transparent !important;
  padding: 0 !important;
}

/* === Docs Hub === */
.docs-hub {
  padding: 4rem 0 5rem;
}

.docs-hub-header {
  text-align: center;
  margin-bottom: 3rem;
}

.docs-hub-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.docs-hub-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.doc-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.doc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
  transform: translateY(-2px);
  color: var(--text);
}

.doc-card-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent);
  background: var(--accent-subtle);
  border-radius: var(--radius);
}

.doc-card-body { flex: 1; min-width: 0; }

.doc-card-body h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.doc-card-body p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.doc-card-body code {
  font-size: 0.8em;
}

.doc-card-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color 0.2s, transform 0.2s;
}

.doc-card:hover .doc-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* === Doc Layout (sidebar + content) === */
.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  align-items: start;
}

@media (max-width: 800px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .doc-sidebar { display: none; }
}

/* Sidebar */
.doc-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-section { }

.sidebar-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.sidebar-section ul {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-section ul a {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}

.sidebar-section ul a:hover {
  color: var(--text);
  background: var(--bg-card);
}

.sidebar-section ul a.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* Doc Content */
.doc-content {
  min-width: 0;
}

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

.doc-breadcrumb a { color: var(--text-muted); }
.doc-breadcrumb a:hover { color: var(--accent); }

.doc-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.doc-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 2rem;
}

.doc-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.doc-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.doc-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.doc-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.doc-content p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.doc-content p strong { color: var(--text); }

.doc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.75rem 0;
  padding-left: 0;
}

.doc-list li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
}

.doc-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.doc-list-ordered {
  list-style: none;
  counter-reset: ol-counter;
}

.doc-list-ordered li {
  counter-increment: ol-counter;
}

.doc-list-ordered li::before {
  content: counter(ol-counter) ".";
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.doc-note {
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.doc-note strong { color: var(--text); }

/* Quickstart more link */
.quickstart-more {
  margin-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* nav active state */
.nav-links a.active { color: var(--text); }
