/* ============================================
   Butter — Marketing Site Styles
   Light warm theme with butter-yellow accent
   ============================================ */

:root {
  --bg-primary: #fffdf7;
  --bg-secondary: #faf5eb;
  --bg-card: #ffffff;
  --bg-code: #fdf6e3;
  --text-primary: #3d2e1c;
  --text-secondary: #6b5a47;
  --text-muted: #9a8b7a;
  --accent: #d4940a;
  --accent-hover: #b37d08;
  --accent-dim: rgba(212, 148, 10, 0.12);
  --border: #e8dcc8;
  --nav-height: 64px;
  --max-width: 1120px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

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

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

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

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

img { max-width: 100%; height: auto; }

/* ---- Nav ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 253, 247, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.nav-brand img {
  height: 36px;
  width: auto;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

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

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

.nav-links .github-link {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links .github-link svg {
  fill: var(--text-muted);
  transition: fill 0.2s;
}

.nav-links .github-link:hover svg { fill: var(--text-primary); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  margin: 5px 0;
  transition: 0.3s;
}

/* ---- Hero ---- */
.hero {
  padding: calc(var(--nav-height) + 80px) 24px 80px;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-logo {
  height: 160px;
  width: auto;
  margin-bottom: 24px;
  border-radius: 8px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

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

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

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

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

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

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

.section-alt {
  background: var(--bg-secondary);
}

.section-alt .section {
  padding-left: 24px;
  padding-right: 24px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 48px;
  max-width: 600px;
}

/* ---- Features ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(61, 46, 28, 0.06);
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(212, 148, 10, 0.1);
}

.feature-card .icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
  display: block;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.feature-card.coming-soon {
  opacity: 0.6;
  border-style: dashed;
}

.coming-soon-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* ---- Quick Start ---- */
.steps {
  counter-reset: step;
}

.step {
  margin-bottom: 32px;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.step h3::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- Code Blocks ---- */
pre[class*="language-"] {
  background: var(--bg-code) !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

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

:not(pre) > code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
}

/* ---- Architecture ---- */
.architecture-diagram {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre;
}

.architecture-diagram .highlight { color: var(--accent); }

/* ---- Performance Table ---- */
.perf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}

.perf-table th,
.perf-table td {
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.perf-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.perf-table td { font-size: 0.95rem; }

.perf-table .target {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero .subtitle { font-size: 1.05rem; }
  .hero-logo { height: 120px; }

  .features-grid { grid-template-columns: 1fr; }

  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }

  .section { padding: 48px 16px; }
  .section-title { font-size: 1.5rem; }

  pre[class*="language-"] {
    padding: 16px;
    font-size: 0.8rem;
  }

  .perf-table th,
  .perf-table td { padding: 10px 12px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
