/* SpecAg — Package Website Styles */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --accent: #10b981;
  --accent-dark: #059669;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --border: #e2e8f0;
  --code-bg: #f1f5f9;
  --code-text: #0f172a;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --text-light: #94a3b8;
  --text-lighter: #64748b;
  --border: #334155;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

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

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

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

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.9);
}

[data-theme="dark"] .header {
  background: rgba(15,23,42,0.9);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
}

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

.nav a {
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav a:hover, .nav a.active {
  color: var(--text);
  background: var(--bg-alt);
}

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.1rem;
  transition: all 0.2s;
}

.theme-toggle:hover { border-color: var(--text-light); color: var(--text); }

.btn-github {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg-dark);
  color: white;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

[data-theme="dark"] .btn-github { background: #334155; }

.btn-github:hover { opacity: 0.85; color: white; }

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Hero */
.hero {
  padding: calc(var(--header-height) + 5rem) 2rem 5rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}

.hero-inner { max-width: 800px; margin: 0 auto; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(37,99,235,0.1);
  color: var(--primary);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

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

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

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); color: white; }

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

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

.hero-install {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--code-text);
}

.hero-install .prompt { color: var(--accent); user-select: none; }

.hero-install .copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.8rem;
  transition: all 0.2s;
}

.hero-install .copy-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Sections */
.section {
  padding: 5rem 2rem;
}

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

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

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

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-icon.blue { background: rgba(37,99,235,0.1); color: var(--primary); }
.feature-icon.green { background: rgba(16,185,129,0.1); color: var(--accent); }
.feature-icon.orange { background: rgba(245,158,11,0.1); color: #f59e0b; }
.feature-icon.red { background: rgba(239,68,68,0.1); color: #ef4444; }
.feature-icon.purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.feature-icon.cyan { background: rgba(6,182,212,0.1); color: #06b6d4; }

.feature-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-light); font-size: 0.925rem; line-height: 1.6; }

/* Tier Cards */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  transition: all 0.2s;
}

.tier-card:hover { box-shadow: var(--shadow-lg); }

.tier-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.tier-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.2rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.tier-code {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-lighter);
  background: var(--bg-alt);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.tier-price {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0.5rem 0;
}

.tier-price .period { font-size: 0.9rem; font-weight: 400; color: var(--text-light); }

.tier-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  min-height: 44px;
}

.tier-features {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
}

.tier-features li {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tier-features li:last-child { border-bottom: none; }

.tier-features .check { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.tier-features .dash { color: var(--text-lighter); flex-shrink: 0; }

.tier-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.2s;
}

.tier-btn-primary {
  background: var(--primary);
  color: white;
}

.tier-btn-primary:hover { background: var(--primary-dark); color: white; }

.tier-btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
}

.tier-btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Code Block */
.code-block {
  background: #0f172a;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow-x: auto;
  position: relative;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #e2e8f0;
  line-height: 1.8;
}

.code-block .comment { color: #64748b; }
.code-block .command { color: #38bdf8; }
.code-block .flag { color: #a78bfa; }
.code-block .string { color: #34d399; }
.code-block .prompt { color: #94a3b8; user-select: none; }

.code-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #94a3b8;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.code-copy:hover { background: rgba(255,255,255,0.2); color: white; }

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.comparison-table th,
.comparison-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.comparison-table th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comparison-table tr:last-child td { border-bottom: none; }

.comparison-table .yes { color: var(--accent); font-weight: 600; }
.comparison-table .no { color: var(--text-lighter); }
.comparison-table .partial { color: #f59e0b; font-weight: 500; }

/* Content Pages */
.page-hero {
  padding: calc(var(--header-height) + 3rem) 2rem 3rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

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

.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-hero p { color: var(--text-light); font-size: 1.1rem; }

.content {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

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

.content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content p { margin-bottom: 1rem; color: var(--text); }

.content ul, .content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content li { margin-bottom: 0.5rem; }

.content code {
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--primary-dark);
}

[data-theme="dark"] .content code { color: var(--primary-light); }

.content pre {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.content pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.875rem;
  line-height: 1.8;
}

/* Use Case Cards */
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.usecase-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.2s;
}

.usecase-card:hover { box-shadow: var(--shadow-md); }

.usecase-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-startup { background: rgba(37,99,235,0.1); color: var(--primary); }
.tag-agency { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.tag-solo { background: rgba(16,185,129,0.1); color: var(--accent); }
.tag-enterprise { background: rgba(245,158,11,0.1); color: #f59e0b; }

.usecase-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.usecase-card p { color: var(--text-light); font-size: 0.9rem; }

/* White Paper Cards */
.whitepaper-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  transition: all 0.2s;
}

.whitepaper-card:hover { box-shadow: var(--shadow-md); }

.whitepaper-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.whitepaper-content h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.35rem; }
.whitepaper-content p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.75rem; }

.whitepaper-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-lighter);
}

/* Community */
.community-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.community-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all 0.2s;
}

.community-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.community-card .icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.community-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.community-card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 1rem; }

/* Contact Box */
.contact-box {
  background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(16,185,129,0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  margin-top: 2rem;
}

.contact-box h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.5rem; }
.contact-box p { color: var(--text-light); margin-bottom: 1.5rem; }

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.2s;
}

.contact-email:hover { background: var(--primary-dark); color: white; }

/* Footer */
.footer {
  background: var(--bg-dark);
  color: #94a3b8;
  padding: 4rem 2rem 2rem;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-brand p { color: #64748b; font-size: 0.9rem; margin-top: 0.5rem; }

.footer h4 {
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer-links { list-style: none; }

.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
  color: #94a3b8;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #475569;
}

/* Responsive */
@media (max-width: 768px) {
  .nav { display: none; }
  .hamburger { display: block; }

  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }

  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1.05rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-install { font-size: 0.8rem; }

  .feature-grid, .tier-grid, .community-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  .whitepaper-card { flex-direction: column; gap: 1rem; }

  .section-header h2 { font-size: 1.75rem; }
  .page-hero h1 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.85rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-actions .btn-github span { display: none; }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}

.tab {
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-light);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Callout */
.callout {
  border-left: 4px solid var(--primary);
  background: rgba(37,99,235,0.05);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
}

.callout-warning {
  border-left-color: #f59e0b;
  background: rgba(245,158,11,0.05);
}

.callout p { margin: 0; font-size: 0.925rem; }

/* Matrix Table */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.matrix-table th, .matrix-table td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  text-align: center;
}

.matrix-table th {
  background: var(--bg-alt);
  font-weight: 600;
}

.matrix-table td:first-child { text-align: left; font-weight: 500; }

.badge-req { color: var(--accent); font-weight: 700; }
.badge-rec { color: #f59e0b; font-weight: 600; }
.badge-opt { color: var(--text-light); }
.badge-off { color: var(--text-lighter); font-size: 0.8rem; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.6s ease-out forwards;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-lighter); }
