/* =========================================================
   AI ToolStack Engine — Main Stylesheet
   ========================================================= */

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

:root {
  --color-bg:        #0f1117;
  --color-surface:   #1a1d27;
  --color-border:    #2a2d3e;
  --color-primary:   #6366f1;
  --color-primary-h: #818cf8;
  --color-text:      #e2e8f0;
  --color-muted:     #94a3b8;
  --color-accent:    #10b981;
  --radius:          8px;
  --shadow:          0 2px 8px rgba(0,0,0,0.4);
  --font-sans:       'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;
  --max-width:       900px;
}

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

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

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

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

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

.site-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary-h);
  text-decoration: none;
  letter-spacing: -0.02em;
}

nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}
nav a:hover { color: var(--color-text); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1a1d27 0%, #0f1117 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #818cf8, #6ee7b7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p { color: var(--color-muted); max-width: 600px; margin: 0 auto 1.5rem; }
.hero-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stat  { font-size: 0.85rem; color: var(--color-muted); margin-top: 1rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  cursor: pointer;
  border: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary  { background: var(--color-primary); color: #fff; }
.btn-secondary { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn:not(.btn-primary):not(.btn-secondary) { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.btn:hover { opacity: 0.88; }

/* ── Main / Page content ─────────────────────────────────── */
main.container, .page-content { flex: 1; padding-top: 2.5rem; padding-bottom: 3rem; }

/* ── Card grid ───────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--color-primary); }
.card h2 { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.card h2 a { color: var(--color-text); text-decoration: none; }
.card h2 a:hover { color: var(--color-primary-h); }
.card p { color: var(--color-muted); font-size: 0.875rem; flex: 1; }
.card .btn { align-self: flex-start; margin-top: auto; font-size: 0.8rem; padding: 0.35rem 0.85rem; }

/* ── Value props ─────────────────────────────────────────── */
.value-props { margin-top: 3rem; }
.value-props h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.vp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.vp-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem; }
.vp-item h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--color-primary-h); }
.vp-item p { color: var(--color-muted); font-size: 0.875rem; }

/* ── Section intro ───────────────────────────────────────── */
.section-intro { color: var(--color-muted); margin-bottom: 0.5rem; }

/* ── Article typography ──────────────────────────────────── */
article h1, article h2, article h3, article h4 { line-height: 1.3; letter-spacing: -0.02em; margin-top: 2rem; margin-bottom: 0.75rem; }
article h1 { font-size: 2rem; font-weight: 800; }
article h2 { font-size: 1.5rem; font-weight: 700; color: var(--color-primary-h); }
article h3 { font-size: 1.2rem; font-weight: 600; }
article p  { margin-bottom: 1rem; }
article ul, article ol { padding-left: 1.5rem; margin-bottom: 1rem; }
article li { margin-bottom: 0.35rem; }
article a  { color: var(--color-primary-h); text-decoration: underline; text-decoration-color: transparent; }
article a:hover { text-decoration-color: currentColor; }

/* Tables */
article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; overflow-x: auto; display: block; }
article th, article td { padding: 0.65rem 1rem; text-align: left; border: 1px solid var(--color-border); }
article th { background: var(--color-surface); font-weight: 600; color: var(--color-primary-h); }
article tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* Blockquotes (affiliate CTAs) */
article blockquote {
  background: rgba(99,102,241,0.08);
  border-left: 3px solid var(--color-primary);
  padding: 0.85rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-text);
}
article blockquote strong { color: var(--color-primary-h); }
article blockquote a { color: var(--color-accent); }

/* Code */
article code { background: #1e2030; padding: 0.15em 0.4em; border-radius: 4px; font-family: var(--font-mono); font-size: 0.875em; }
article pre  { background: #1e2030; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.1rem; overflow-x: auto; margin: 1.25rem 0; }
article pre code { background: none; padding: 0; }

/* HR */
article hr { border: none; border-top: 1px solid var(--color-border); margin: 2rem 0; }

/* ── Sidebar note ─────────────────────────────────────────── */
.sidebar-note {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
  margin: 2rem auto;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
}
.site-footer a { color: var(--color-muted); }
.site-footer a:hover { color: var(--color-text); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  nav { gap: 1rem; }
  .hero { padding: 2.5rem 0 2rem; }
  article h1 { font-size: 1.5rem; }
  article h2 { font-size: 1.2rem; }
}
