:root {
  --bg: #0b0d12;
  --bg-elevated: #12151c;
  --bg-card: #161a23;
  --border: #232837;
  --text: #e7e9ee;
  --text-muted: #9aa1b2;
  --accent: #5b8cff;
  --accent-hover: #7ba0ff;
  --accent-soft: rgba(91, 140, 255, 0.12);
  --success: #3ecf8e;
  --warning: #e8b94b;
  --danger: #ef6461;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --max-width: 1180px;
  font-size: 16px;
}

* { box-sizing: border-box; }

/* Ambient background effect (crystal.js) — sits fixed behind all content */
#bg_glow {
  position: fixed; inset: 0; z-index: -3;
  transition: background 1.2s ease;
  pointer-events: none;
}
#canvas {
  position: fixed; inset: 0; z-index: -2;
  pointer-events: none;
  opacity: 0.55;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,13,18,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: var(--max-width); margin: 0 auto;
}
.nav-logo { font-weight: 700; font-size: 1.25rem; color: var(--text); }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

@media (max-width: 860px) {
  .nav-links { position: absolute; top: 68px; left: 0; right: 0; background: var(--bg-elevated);
    flex-direction: column; padding: 16px 24px; border-bottom: 1px solid var(--border); display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 64px; text-align: center; }
.hero h1 { font-size: 2.75rem; line-height: 1.15; margin: 0 0 18px; }
.hero p.lead { color: var(--text-muted); font-size: 1.15rem; max-width: 640px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-title { font-size: 1.9rem; margin: 0 0 8px; }
.section-subtitle { color: var(--text-muted); margin: 0 0 40px; max-width: 620px; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px;
}
.card:hover { border-color: #2c3346; }

/* ---------- Product cards ---------- */
.product-card { display: flex; flex-direction: column; gap: 12px; }
.product-card .logo { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.badge-active { background: rgba(62,207,142,0.15); color: var(--success); }
.badge-beta { background: rgba(232,185,75,0.15); color: var(--warning); }
.badge-coming_soon { background: var(--accent-soft); color: var(--accent); }
.badge-deprecated { background: rgba(239,100,97,0.15); color: var(--danger); }
.product-price { color: var(--text-muted); font-size: 0.9rem; margin-top: auto; }

/* ---------- Filters / search ---------- */
.filters-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.filters-bar input, .filters-bar select {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  padding: 10px 14px; border-radius: var(--radius); font-size: 0.95rem;
}
.filters-bar input { flex: 1; min-width: 220px; }

/* ---------- Pricing ---------- */
.pricing-toggle { display: flex; justify-content: center; gap: 8px; margin-bottom: 40px; }
.pricing-toggle button { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); padding: 8px 18px; border-radius: 999px; cursor: pointer; }
.pricing-toggle button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.plan-card { display: flex; flex-direction: column; gap: 16px; position: relative; }
.plan-card .price { font-size: 2.2rem; font-weight: 700; }
.plan-card .price small { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
.plan-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; color: var(--text-muted); font-size: 0.92rem; }
.plan-card ul li:before { content: "✓ "; color: var(--success); font-weight: 700; }
.plan-note { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  padding: 11px 14px; border-radius: var(--radius); font-size: 0.95rem; font-family: inherit;
}
.form-group textarea { resize: vertical; }
.auth-card { max-width: 420px; margin: 80px auto; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; }
.alert-error { background: rgba(239,100,97,0.12); border: 1px solid rgba(239,100,97,0.35); color: #ff9c99; }
.alert-success { background: rgba(62,207,142,0.12); border: 1px solid rgba(62,207,142,0.35); color: #8fe8bd; }

/* ---------- Legal pages ---------- */
.legal-layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; padding: 64px 0; }
.legal-toc { position: sticky; top: 90px; align-self: start; font-size: 0.88rem; }
.legal-toc a { display: block; padding: 6px 0; color: var(--text-muted); }
.legal-content { max-width: 720px; font-size: 1rem; }
.legal-content h2 { margin-top: 40px; font-size: 1.4rem; }
.legal-content p, .legal-content li { color: #cdd2de; }
.legal-updated { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 32px; }
@media (max-width: 800px) { .legal-layout { grid-template-columns: 1fr; } .legal-toc { position: static; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 32px; margin-top: 64px; color: var(--text-muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-grid h4 { color: var(--text); font-size: 0.9rem; margin: 0 0 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid ul a { color: var(--text-muted); font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Admin ---------- */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--bg-elevated); border-right: 1px solid var(--border); padding: 24px 16px; flex-shrink: 0; }
.admin-sidebar .brand { font-weight: 700; padding: 0 8px 24px; }
.admin-sidebar a { display: block; padding: 10px 12px; border-radius: var(--radius); color: var(--text-muted); font-size: 0.9rem; margin-bottom: 4px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--accent-soft); color: var(--accent); }
.admin-main { flex: 1; padding: 32px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
table.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table.admin-table th, table.admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.admin-table th { color: var(--text-muted); font-weight: 600; background: var(--bg-elevated); }
table.admin-table tr:last-child td { border-bottom: none; }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.status-draft { background: rgba(232,185,75,0.15); color: var(--warning); }
.status-published { background: rgba(62,207,142,0.15); color: var(--success); }
.status-unpublished { background: rgba(239,100,97,0.15); color: var(--danger); }

h1, h2, h3 { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
