/* ==========================================================================
   MiniPC Hub — design layer on top of Bootstrap 6.
   Bootstrap 6 ships its rules inside cascade layers, so these unlayered rules
   win without !important. Colours come from Bootstrap's light-dark() tokens
   (--bs-fg-*, --bs-bg-*, --bs-primary-*), so both themes work automatically.
   ========================================================================== */

:root {
  --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bs-font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;

  --hub-border: var(--bs-border-color);
  --hub-card-bg: var(--bs-bg-1);
  --hub-surface-2: var(--bs-bg-2);
  --hub-muted: var(--bs-fg-3);
  --hub-primary: var(--bs-primary-fg);
  --hub-hover-border: light-dark(#4f46e5, #6366f1);
  --hub-glow: light-dark(rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.15));
  --hub-badge-bg: light-dark(#e0e7ff, rgba(99, 102, 241, 0.12));
  --hub-badge-border: light-dark(#c7d2fe, rgba(99, 102, 241, 0.3));
  --hub-badge-text: light-dark(#4338ca, #818cf8);
  --hub-success: light-dark(#059669, #10b981);
  --hub-warning: light-dark(#b45309, #f59e0b);
  --hub-nav-bg: light-dark(rgba(255, 255, 255, 0.85), rgba(18, 24, 38, 0.82));
  --hub-gradient: light-dark(
    linear-gradient(135deg, #0284c7 0%, #4f46e5 50%, #9333ea 100%),
    linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%)
  );
}

[x-cloak] { display: none !important; }

body {
  letter-spacing: -0.011em;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4 { letter-spacing: -0.02em; }

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  padding: 0.5rem 1rem;
  background: var(--bs-bg-body);
  border-radius: 0.5rem;
}

/* ---------- Navigation ---------- */
.glass-nav {
  z-index: 999;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--hub-nav-bg);
  border-bottom: 1px solid var(--hub-border);
}
.glass-nav > nav { min-height: 3.75rem; }
.brand { color: var(--bs-fg-body); font-weight: 800; font-size: 1.25rem; }
.brand:hover { color: var(--bs-fg-body); }
.brand-icon, .brand-accent { color: var(--hub-primary); }
.glass-nav .nav-link { font-size: 0.92rem; color: var(--bs-fg-2); border-radius: 0.5rem; }
.glass-nav .nav-link:hover { color: var(--bs-fg-body); }
.glass-nav .nav-link.active { color: var(--hub-primary); font-weight: 600; }
.icon-btn { align-items: center; justify-content: center; padding: 0.4rem 0.6rem; }
.icon-btn:not(.md\:d-none) { display: inline-flex; }
@media (width >= 768px) { .icon-btn.md\:d-none { display: none; } }
@media (width < 768px) { .icon-btn.md\:d-none { display: inline-flex; } }

/* ---------- Generic section helpers ---------- */
.section { padding: 3rem 0; }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 2rem; }
.section-head h2 { font-weight: 800; margin-bottom: 0.5rem; }
.section-head p { color: var(--hub-muted); margin-bottom: 0; }
.muted { color: var(--hub-muted); }
.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hub-primary);
  margin-bottom: 0.25rem;
}
.page-head { padding: 3.5rem 0 1.5rem; }
.page-head h1 { font-weight: 800; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15; }
.page-head .lede { font-size: 1.1rem; color: var(--hub-muted); max-width: 720px; }

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 3rem; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--hub-badge-bg);
  color: var(--hub-badge-text);
  border: 1px solid var(--hub-badge-border);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}
.gradient-text {
  background: var(--hub-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lede { max-width: 680px; margin: 0 auto; font-size: 1.15rem; color: var(--hub-muted); }

/* ---------- Cards ---------- */
.hub-card {
  border: 1px solid var(--hub-border);
  border-radius: 1rem;
  background: var(--hub-card-bg);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.hub-card.lift:hover {
  border-color: var(--hub-hover-border);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}
.metric-box { padding: 1.2rem; text-align: left; }
.metric-box:hover { transform: translateY(-2px); border-color: var(--hub-hover-border); }
.metric-val { font-size: 1.75rem; font-weight: 700; color: var(--hub-primary); margin-bottom: 0.2rem; }
.metric-label { font-size: 0.875rem; color: var(--hub-muted); }

.spec-card { display: flex; flex-direction: column; padding: 1.6rem; height: 100%; }
.spec-card > header { border-bottom: 1px solid var(--hub-border); padding-bottom: 1rem; margin-bottom: 0.4rem; }
.spec-card-title { font-size: 1.3rem; font-weight: 700; margin: 0; line-height: 1.25; }
.spec-card-title a { color: inherit; text-decoration: none; }
.spec-card-title a::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.spec-card { position: relative; }
.spec-card-sub { font-size: 0.9rem; color: var(--hub-muted); margin-top: 0.3rem; }
.spec-card-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--hub-border); }
.label-caps {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--hub-muted);
  margin-bottom: 0.2rem;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0; }
.tag-list .badge { font-family: var(--bs-font-mono); font-weight: 600; }

/* Compact key/value table */
.kv-table { width: 100%; font-size: 0.88rem; margin: 0.5rem 0 1rem; }
.kv-table td { padding: 0.4rem 0; border-bottom: 1px dashed var(--hub-border); vertical-align: top; }
.kv-table tr:last-child td { border-bottom: none; }
.kv-table td.k { color: var(--hub-muted); width: 42%; padding-right: 0.75rem; }
.kv-table td.v { font-weight: 600; text-align: right; }
.watts { color: var(--hub-success); }
.price { font-size: 1.1rem; font-weight: 800; color: var(--hub-primary); }

/* ---------- Filter chips ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 2rem; }
.filter-bar.is-start { justify-content: flex-start; }
.filter-bar .chip { --bs-chip-height: 2.1rem; --bs-chip-padding-x: 1rem; font-size: 0.88rem; font-weight: 500; cursor: pointer; }

/* ---------- Recommendation finder ---------- */
.wizard-card { padding: 2.2rem; box-shadow: 0 10px 30px var(--hub-glow); }
.step-label { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--hub-primary); margin-bottom: 0.3rem; }
.rec-panel {
  border-radius: 1rem;
  padding: 1.8rem;
  background: var(--hub-surface-2);
  border: 1px solid var(--hub-hover-border);
  margin-top: 2rem;
}
.rec-inner { background: var(--hub-card-bg); border: 1px solid var(--hub-border); border-radius: 0.6rem; padding: 1rem; }
.pitfall {
  border-left: 4px solid var(--hub-warning);
  padding: 0.8rem 1rem;
  background: color-mix(in srgb, var(--hub-warning) 9%, transparent);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}
.pitfall strong { color: var(--hub-warning); display: block; margin-bottom: 0.2rem; }

/* ---------- Accordion (Bootstrap 6 native <details>) ---------- */
.accordion { --bs-accordion-gap: 1rem; --bs-accordion-bg: var(--hub-card-bg); --bs-accordion-btn-bg: var(--hub-card-bg); }
.accordion-header { font-weight: 600; font-size: 1.05rem; }
.accordion-item[open] { border-color: var(--hub-primary); }
.accordion-body ul:last-child, .accordion-body p:last-child { margin-bottom: 0; }

/* ---------- Detail pages ---------- */
.breadcrumb { font-size: 0.85rem; margin-bottom: 1rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.25rem; }
.detail-meta .label-caps { margin-bottom: 0; }
.detail-meta strong { font-size: 1.1rem; }
.spec-group { padding: 1.4rem 1.5rem; height: 100%; }
.spec-group h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.list-check, .list-cross { list-style: none; padding-left: 0; margin-bottom: 0; }
.list-check li, .list-cross li { position: relative; padding-left: 1.6rem; margin-bottom: 0.5rem; }
.list-check li::before { content: '✓'; position: absolute; left: 0; color: var(--hub-success); font-weight: 700; }
.list-cross li::before { content: '✕'; position: absolute; left: 0; color: var(--hub-warning); font-weight: 700; }

/* ---------- Tutorials ---------- */
.tutorial-body { max-width: 820px; }
.step { padding: 1.5rem 0; border-top: 1px solid var(--hub-border); }
.step h2 { font-size: 1.3rem; font-weight: 700; display: flex; gap: 0.75rem; align-items: baseline; }
.step-num {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 0.9rem;
  background: var(--hub-badge-bg);
  color: var(--hub-badge-text);
  border: 1px solid var(--hub-badge-border);
}
.code-block { position: relative; margin: 1rem 0; }
.code-block pre {
  font-family: var(--bs-font-mono);
  font-size: 0.85rem;
  background: var(--hub-surface-2);
  border: 1px solid var(--hub-border);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem;
  padding-right: 4.5rem;
  margin: 0;
  overflow-x: auto;
}
.code-block .copy-btn { position: absolute; top: 0.5rem; right: 0.5rem; }
.code-label { font-size: 0.75rem; color: var(--hub-muted); font-family: var(--bs-font-mono); margin-bottom: 0.3rem; }
code { font-family: var(--bs-font-mono); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hub-border); padding: 3rem 0; margin-top: 2rem; font-size: 0.9rem; }
.site-footer a { color: var(--bs-fg-2); text-decoration: none; }
.site-footer a:hover { color: var(--hub-primary); }
.site-footer li { margin-bottom: 0.35rem; }
.footer-heading { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--hub-muted); margin-bottom: 0.6rem; }

@media (max-width: 768px) {
  .hero { padding: 3rem 0 2rem; }
  .wizard-card, .rec-panel { padding: 1.4rem; }
}

/* ---------- Comparison table & tutorial aside ---------- */
.compare-table { font-size: 0.88rem; min-width: 900px; }
.compare-table th[scope=row] { color: var(--hub-muted); font-weight: 600; white-space: nowrap; }
.compare-table thead th a { color: var(--bs-fg-body); text-decoration: none; }
.compare-table thead th a:hover { color: var(--hub-primary); }
.sticky-aside { position: sticky; top: 5rem; }

/* Tutorial cards sit in tall columns — don't stretch them to the column height
   (.spec-group's height:100% made "What you need" and the sticky aside span the whole page). */
.tutorial-body .spec-group,
.spec-group.sticky-aside { height: auto; }
.tutorial-body .spec-group h2 { margin-bottom: 0.75rem; }
.sticky-aside ol { margin-bottom: 0; }
.sticky-aside a { color: var(--bs-fg-2); text-decoration: none; }
.sticky-aside a:hover { color: var(--hub-primary); }
