/* QFrame 3D — static SEO pages (catalogue, model guides, 404).
   Warm-paper tokens mirror src/styles.css. External stylesheet only: the
   generated pages contain zero inline style or script elements, so they stay
   fully compatible with a strict Content-Security-Policy. */

:root {
  --bg: #faf9f6;
  --stage: #f3f1ec;
  --surface: #ffffff;
  --ink: #14171f;
  --ink-muted: #4b5260;
  --ink-soft: #6b7280;
  --border: rgba(20, 23, 31, 0.12);
  --border-strong: rgba(20, 23, 31, 0.24);
  --accent: #b91c1c;
  --green: #16a34a;
  --yellow: #eab308;
  --red: #dc2626;
  --blue: #2563eb;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 246, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 2px;
}

.brand-mark i { display: block; border-radius: 2px; }
.brand-mark i:nth-child(1) { background: var(--red); }
.brand-mark i:nth-child(2) { background: var(--green); }
.brand-mark i:nth-child(3) { background: var(--blue); }
.brand-mark i:nth-child(4) { background: var(--yellow); }

.top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13.5px; color: var(--ink-muted); }
.top-nav a { color: var(--ink-muted); }
.top-nav a:hover { color: var(--ink); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:hover { text-decoration: none; opacity: 0.92; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12.5px; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.crumbs { font-size: 12.5px; color: var(--ink-soft); padding: 16px 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li::after { content: '›'; margin-left: 6px; color: var(--border-strong); }
.crumbs li:last-child::after { content: none; }

/* ── Hero / summary card ─────────────────────────────────────────────────── */
.hero { padding: 18px 0 6px; }

.hero-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--stage);
  padding: clamp(18px, 3vw, 30px);
}

.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.badge.free { border-color: rgba(22, 163, 74, 0.35); background: rgba(22, 163, 74, 0.1); color: #166534; }
.badge.mega { border-color: rgba(185, 28, 28, 0.3); background: rgba(185, 28, 28, 0.08); color: var(--accent); }

h1 { margin: 6px 0 8px; font-size: clamp(24px, 4vw, 38px); line-height: 1.15; letter-spacing: -0.02em; }
h2 { margin: 34px 0 12px; font-size: 20px; letter-spacing: -0.01em; }
h3 { margin: 0 0 6px; font-size: 15px; }

.lede { color: var(--ink-muted); max-width: 74ch; margin: 0 0 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }

/* ── Spec / BOM ──────────────────────────────────────────────────────────── */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 14px 0 6px;
}

.spec {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
}

.spec dt { font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 3px; }
.spec dd { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }

table { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-size: 13.5px; }
caption { text-align: left; font-size: 12.5px; color: var(--ink-soft); padding-bottom: 6px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); background: var(--stage); }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; border: 1px solid var(--border); }

/* ── Steps ───────────────────────────────────────────────────────────────── */
ol.steps { list-style: none; counter-reset: step; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
ol.steps li {
  counter-increment: step;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px 14px 11px 48px;
  position: relative;
  font-size: 14px;
}
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 13px;
  top: 11px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.steps strong { display: block; }

/* ── Cards / catalogue ───────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 14px 0 0; }

.card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.card:hover { border-color: var(--border-strong); text-decoration: none; transform: translateY(-1px); }
.card .id { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--accent); }
.card strong { font-size: 14px; line-height: 1.35; }
.card span { font-size: 12px; color: var(--ink-soft); }
.card .free-tag { color: #15803d; font-weight: 700; }

.series-block { padding-top: 6px; scroll-margin-top: 74px; }
.series-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin: 30px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.series-head h2 { margin: 0; }
.series-head p { margin: 0; font-size: 13px; color: var(--ink-soft); max-width: 62ch; }

.toc { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; }
.toc a { display: inline-flex; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--ink-muted); background: var(--surface); }
.toc a:hover { border-color: var(--border-strong); text-decoration: none; }

/* ── FAQ / footer ────────────────────────────────────────────────────────── */
details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px 14px; margin: 8px 0; }
summary { cursor: pointer; font-weight: 700; font-size: 14px; }
details p { margin: 8px 0 0; color: var(--ink-muted); font-size: 13.5px; }

footer.foot { margin-top: 40px; border-top: 1px solid var(--border); background: var(--stage); }
.foot-inner { padding: 22px 0 30px; font-size: 12.5px; color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; }
.foot-links a { color: var(--ink-muted); }
.foot p { margin: 0 0 6px; max-width: 90ch; }

.note { border-left: 3px solid var(--border-strong); padding: 2px 0 2px 12px; color: var(--ink-soft); font-size: 13px; margin: 14px 0; }

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .top-inner { padding: 8px 0; }
  .hero-card { border-radius: 12px; }
  table { font-size: 12.5px; }
  th, td { padding: 7px 8px; }
}

/* BOM colour swatches are driven by data attributes so generated pages stay
   free of inline styles (strict-CSP safe). */
.swatch[data-color='#16a34a'] { background: #16a34a; }
.swatch[data-color='#eab308'] { background: #eab308; }
.swatch[data-color='#f59e0b'] { background: #f59e0b; }
.swatch[data-color='#dc2626'] { background: #dc2626; }
.swatch[data-color='#2563eb'] { background: #2563eb; }
.swatch[data-color='#1f2937'] { background: #1f2937; }
.swatch[data-color='#ef4444'] { background: #ef4444; }
.swatch[data-color='#94a3b8'] { background: #94a3b8; }
.swatch[data-color='#1d4ed8'] { background: #1d4ed8; }
.swatch[data-color='#3b82f6'] { background: #3b82f6; }
.swatch[data-color='#475569'] { background: #475569; }
.swatch[data-color='#0284c7'] { background: #0284c7; }
.swatch[data-color='#facc15'] { background: #facc15; }
.swatch[data-color='#334155'] { background: #334155; }
