:root {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #182032;
  --border: #253047;
  --text: #e6edf7;
  --muted: #93a4be;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.14);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(circle at 15% 0%, #15213b 0%, var(--bg) 48%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #06101f;
}
.nav-links {
  display: flex;
  gap: 20px;
  font-size: 0.92rem;
}
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  padding: 36px 0 24px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}
h1 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.hero-sub {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  font-size: 1.02rem;
}

/* Calculator Grid */
.calc-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  margin-top: 24px;
  align-items: start;
}
@media (max-width: 880px) {
  .calc-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
}
label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
label .val-tag {
  color: var(--accent);
  font-family: var(--mono);
}
select, input[type="number"] {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
}
select:focus, input[type="number"]:focus {
  border-color: var(--accent);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Verdict Card */
.verdict-banner {
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}
.verdict-banner.fit { background: var(--green-bg); border-color: rgba(16, 185, 129, 0.45); }
.verdict-banner.tight { background: var(--amber-bg); border-color: rgba(245, 158, 11, 0.45); }
.verdict-banner.nofit { background: var(--red-bg); border-color: rgba(239, 68, 68, 0.45); }
.verdict-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 4px;
}
.verdict-banner.fit .verdict-title { color: #34d399; }
.verdict-banner.tight .verdict-title { color: #fbbf24; }
.verdict-banner.nofit .verdict-title { color: #f87171; }
.verdict-desc { margin: 0; font-size: 0.9rem; color: var(--text); opacity: 0.92; }

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 520px) {
  .metrics-row { grid-template-columns: 1fr; }
}
.metric-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.metric-label { font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.metric-value { font-size: 1.32rem; font-weight: 800; font-family: var(--mono); margin-top: 2px; }

/* Stacked VRAM Bar */
.bar-wrap { margin-bottom: 18px; }
.bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.bar-track {
  height: 14px;
  background: #0d1320;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}
.bar-weights { background: #38bdf8; height: 100%; transition: width 0.2s ease; }
.bar-kv { background: #a855f7; height: 100%; transition: width 0.2s ease; }
.bar-overhead { background: #64748b; height: 100%; transition: width 0.2s ease; }
.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

/* Ollama Command */
.cmd-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.84rem;
  margin-bottom: 16px;
  overflow-x: auto;
}
.btn-copy {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

/* Affiliate CTA Card */
.cta-card {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(129, 140, 248, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
}
.cta-card h4 { margin: 0 0 4px; font-size: 0.94rem; }
.cta-card p { margin: 0 0 10px; font-size: 0.84rem; color: var(--muted); }
.cta-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101f;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 8px 14px;
  border-radius: 8px;
}
.btn-primary:hover { text-decoration: none; opacity: 0.92; }
.btn-secondary {
  display: inline-block;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 8px 14px;
  border-radius: 8px;
}
.btn-secondary:hover { text-decoration: none; border-color: var(--accent); }

/* Sections & Tables */
section.content-section {
  margin-top: 40px;
}
section.content-section h2 {
  font-size: 1.35rem;
  margin: 0 0 14px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px;
}
.link-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.link-card .lc-title { font-weight: 700; font-size: 0.98rem; margin-bottom: 4px; }
.link-card .lc-meta { font-size: 0.82rem; color: var(--muted); }
.badge-sm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--mono);
}
.badge-fit { background: var(--green-bg); color: #34d399; }
.badge-tight { background: var(--amber-bg); color: #fbbf24; }
.badge-nofit { background: var(--red-bg); color: #f87171; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td.mono { font-family: var(--mono); }

/* FAQ & Breadcrumb */
.breadcrumb {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { margin: 0 0 6px; font-size: 1rem; }
.faq-item p { margin: 0; color: var(--muted); font-size: 0.92rem; }

footer.site-footer {
  margin-top: 64px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
