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

:root {
  --bg:         #0d1117;
  --bg-surface: #161b22;
  --bg-card:    #1c2128;
  --border:     #30363d;
  --text:       #e6edf3;
  --text-muted: #8b949e;
  --accent:     #58a6ff;
  --accent-dim: #1f3a5f;
  --green:      #3fb950;
  --red:        #f85149;
  --font-mono:  "JetBrains Mono", "Fira Mono", "Cascadia Code", monospace;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius:     6px;
  --max-width:  1100px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}

code:not(pre code) {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15em 0.4em;
  font-size: 0.85em;
}

h1, h2, h3, h4 { line-height: 1.3; margin-bottom: 0.5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; margin-top: 2rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }
p  { margin-bottom: 1rem; }
ul, ol { margin: 0.5rem 0 1rem 1.5rem; }
li { margin-bottom: 0.25rem; }

/* === Layout === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.site-main  { flex: 1; }

/* === Header === */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.site-title:hover { text-decoration: none; }
.logo-bracket { color: var(--text-muted); }
.logo-accent  { color: var(--accent); }

.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.15s; }
.site-nav a:hover, .site-nav a.active { color: var(--text); text-decoration: none; }

/* === Hero === */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-family: var(--font-mono);
  font-weight: 700;
  margin-bottom: 1rem;
}

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

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.btn-group { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.15s;
  cursor: pointer;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary  { background: var(--accent); color: #0d1117; }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }

/* === Features Grid === */
.features {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.features h2 { text-align: center; border: none; margin-bottom: 2rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.feature-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1rem; margin-top: 0; color: var(--text); }
.feature-card p  { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* === Attack chain diagram === */
.chain-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
}
.chain-block pre { background: none; border: none; padding: 0; }

/* === Docs page layout === */
.page-wrapper {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  gap: 2.5rem;
  align-items: flex-start;
}

.docs-sidebar {
  flex: 0 0 200px;
  position: sticky;
  top: 4.5rem;
}

.docs-sidebar strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.docs-sidebar ul { list-style: none; margin: 0; padding: 0; }
.docs-sidebar li { margin-bottom: 0.25rem; }
.docs-sidebar a { font-size: 0.875rem; color: var(--text-muted); }
.docs-sidebar a:hover { color: var(--text); text-decoration: none; }

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

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.825rem;
}

.footer-links { margin-top: 0.25rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* === Illustrations === */
.illustration-panel {
  background: #f5f0e8;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.illustration-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hero: large illustration to the right of the copy */
.hero-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
  text-align: left;
}

.hero-copy { flex: 1; }
.hero-copy .btn-group { justify-content: flex-start; }

.hero-image {
  flex: 0 0 420px;
  height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f5f0e8;
  box-shadow: 0 0 0 1px var(--border);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Inline doc illustrations */
.doc-illustration {
  background: #f5f0e8;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--border);
  margin: 2rem 0;
  overflow: hidden;
  max-height: 300px;
  display: flex;
  justify-content: center;
}

.doc-illustration img {
  max-height: 300px;
  width: auto;
  display: block;
}

/* === Responsive === */
@media (max-width: 768px) {
  .page-wrapper { flex-direction: column; }
  .docs-sidebar { position: static; flex: none; width: 100%; }
  .hero { padding: 3rem 0; }
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-copy .btn-group { justify-content: center; }
  .hero-image { flex: none; width: 100%; height: 220px; }
}
