/* ============================================================
   Brake Swap — Main Stylesheet
   Base · Layout · Caliper Header · Footer · Components
   ============================================================ */

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--g-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: var(--header-h);
}
img { max-width: 100%; display: block; }
a { color: var(--o-400); text-decoration: none; }
a:hover { color: var(--s-500); }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .005em;
  color: var(--text);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.18rem, 2vw, 1.4rem); }
h4 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
code, .mono { font-family: var(--font-mono); font-size: .9em; }

/* Inline body links get orange underline */
.prose a { color: var(--o-400); text-decoration: underline; text-decoration-color: var(--o-900); text-underline-offset: 3px; }
.prose a:hover { color: var(--s-500); }

/* Focus ring */
:focus-visible { outline: 2px solid var(--o-500); outline-offset: 2px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: var(--container-narrow); }
.container.wide { max-width: var(--container-wide); }

.section { padding: 56px 0; }
.section-sm { padding: 36px 0; }
.section-tight { padding: 40px 0 56px; }
.section-hero-pad { padding-top: calc(var(--header-h) + 24px); }

.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: 1fr; }
  body { padding-top: calc(var(--brand-h) + var(--nav-h)); }
}

/* Section headers */
.eyebrow {
  font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--o-500); display: inline-flex; align-items: center; gap: .4em; margin: 0 0 .6em;
}
.eyebrow::before { content: "◉"; color: var(--o-500); }
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--text-2); max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 11px 20px; border-radius: var(--r-pill);
  font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  cursor: pointer; border: 1px solid transparent; transition: var(--t-fast);
  font-family: var(--font-body); line-height: 1.1; text-decoration: none;
}
.btn:hover { color: var(--text); }
.btn.primary { background: var(--o-500); color: #1a1208; }
.btn.primary:hover { background: var(--o-400); box-shadow: var(--sh-sm); }
.btn.metal { background: var(--s-500); color: #1a1a1a; }
.btn.metal:hover { background: var(--s-400); }
.btn.outline { background: var(--g-900); color: var(--o-400); border-color: var(--o-500); }
.btn.outline:hover { background: var(--o-500); color: #1a1208; }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--border-strong); }
.btn.ghost:hover { color: var(--text); border-color: var(--s-600); }
.btn.danger { background: var(--red-600); color: #fff; }
.btn.sm { padding: 7px 14px; font-size: .78rem; }
.btn.lg { padding: 14px 26px; font-size: 1rem; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Caliper-clamp CTA */
.btn-clamp { position: relative; }
.btn-clamp .clamp-ico { display: inline-block; transition: transform .25s ease; }
.btn-clamp:hover .clamp-ico { transform: scaleX(.82) translateX(2px); }

/* ---------- Tags / Chips / Badges ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .35em;
  padding: 3px 10px; border-radius: var(--r-pill); font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; line-height: 1.4;
}
.tag.orange { background: var(--o-500); color: #1a1208; }
.tag.metal { background: var(--s-700); color: #1a1a1a; }
.tag.rubber { background: var(--r-700); color: var(--text); border: 1px solid var(--border); }
.tag.red { background: var(--red-800); color: var(--red-300); }
.tag.outline { background: transparent; color: var(--o-400); border: 1px solid var(--o-800); }

.chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: 7px 14px; border-radius: var(--r-pill); font-size: .82rem;
  background: var(--g-850); color: var(--text-2); border: 1px solid var(--border);
  cursor: pointer; transition: var(--t-fast); text-decoration: none;
}
.chip:hover { border-color: var(--o-500); color: var(--text); }
.chip.active { background: var(--o-500); color: #1a1208; border-color: var(--o-500); }

/* Param badge (mono, gap/torque/size/time) */
.param-badge {
  display: inline-block; font-family: var(--font-mono); font-size: .78rem;
  background: var(--g-850); color: var(--o-300); border: 1px solid var(--o-800);
  padding: 2px 8px; border-radius: var(--r-sm);
}

/* 3D badge */
.badge-3d {
  display: inline-flex; align-items: center; gap: .35em;
  background: var(--o-500); color: #1a1208; font-weight: 700; font-size: .7rem;
  padding: 3px 9px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .05em;
}

/* Difficulty badge */
.difficulty-badge {
  display: inline-flex; align-items: center; gap: .4em; font-family: var(--font-mono);
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; padding: 3px 9px; border-radius: var(--r-sm);
}
.difficulty-badge.easy { background: var(--gr-900); color: var(--gr-500); }
.difficulty-badge.medium { background: #2E2410; color: var(--note); }
.difficulty-badge.pro { background: var(--red-900); color: var(--red-400); }

/* WebGL status */
.webgl-status {
  display: inline-flex; align-items: center; gap: .5em; font-family: var(--font-mono);
  font-size: .74rem; letter-spacing: .05em; padding: 4px 10px; border-radius: var(--r-sm);
  background: var(--g-850); color: var(--text-2);
}
.webgl-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--g-600); }
.webgl-status.loading .dot { background: var(--note); }
.webgl-status.ready .dot { background: var(--ok); }
.webgl-status.fallback .dot { background: var(--o-500); }
.webgl-status.error .dot { background: var(--red-600); }

/* ---------- Cards (whole-card clickable) ---------- */
.card {
  display: flex; flex-direction: column; position: relative;
  background: var(--g-850); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--sh-sm); color: var(--text); text-decoration: none; overflow: hidden;
  transition: var(--t-mid); cursor: pointer; min-height: 44px;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--o-500); }
.card:active { transform: translateY(-1px); }
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--o-500), transparent); opacity: .6;
}
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--g-900); display: grid; place-items: center; }
.card-media svg, .card-media img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-media img, .card:hover .card-media .zoom { transform: scale(1.04); }
.card-media img, .card-media .zoom { transition: transform .28s ease; }
.card-body { padding: 18px; flex: 1; }
.card-title { font-family: var(--font-head); font-size: 1.06rem; font-weight: 700; margin: 0 0 .35em; color: var(--text); }
.card-desc { color: var(--text-2); font-size: .92rem; margin: 0; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--border); margin-top: auto;
}
.card-arrow { color: var(--o-400); font-weight: 700; }
.card:hover .card-arrow { transform: translateX(4px); }
.card-arrow { transition: transform .2s ease; }

/* Diagnostic card */
.diag-card .diag-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--o-500); display: grid; place-items: center; margin-bottom: 12px; color: #1a1208; }
.diag-card .card-body { display: flex; flex-direction: column; gap: 6px; }

/* Tool / part card */
.tool-card .card-media { background: linear-gradient(135deg, var(--g-900), var(--r-700)); }
.part-card .part-thumb { aspect-ratio: 16/9; background: var(--g-900); display: grid; place-items: center; }
.part-card .part-meta { font-family: var(--font-mono); font-size: .78rem; color: var(--text-2); }
.price-range { color: var(--o-300); font-family: var(--font-mono); font-size: .8rem; }

/* Blog card */
.blog-card .card-media { aspect-ratio: 16 / 9; }
.blog-meta { display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-size: .72rem; color: var(--text-3); }

/* Calc card with mini input */
.calc-card .card-body { gap: 10px; }

/* Sim card */
.sim-card { background: linear-gradient(160deg, var(--g-850), var(--r-700)); }
.sim-card .card-media { aspect-ratio: 16/10; background: radial-gradient(circle at 50% 40%, var(--g-800), var(--g-950)); }

/* QA card */
.qa-card { border-left: 3px solid var(--o-500); padding: 0; }
.qa-card .qa-inner { padding: 18px; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.qa-q { font-style: italic; color: var(--text); }
.qa-q::before { content: "“"; }
.qa-q::after { content: "”"; }
.qa-source { font-family: var(--font-mono); font-size: .72rem; color: var(--text-3); }
.qa-a { font-size: .9rem; color: var(--text-2); }
.qa-a .ok { color: var(--gr-500); font-weight: 700; margin-right: 4px; }

/* Quote card */
.quote-card { border-left: 3px solid var(--o-500); padding: 0; }
.quote-card .quote-inner { padding: 18px; position: relative; }
.quote-card .quote-mark { font-family: var(--font-head); font-size: 2.6rem; color: var(--o-800); line-height: 1; }
.quote-card blockquote { margin: 0 0 10px; color: var(--text); font-size: .96rem; }
.quote-card .quote-src { font-family: var(--font-mono); font-size: .72rem; color: var(--text-3); }

/* Step card (micro-animation driven) */
.step-card { background: var(--g-850); }
.step-card .step-preview {
  aspect-ratio: 16/10; background: var(--g-900); display: grid; place-items: center; position: relative; overflow: hidden;
}
.step-card .step-num { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--o-500); color: #1a1208; display: grid; place-items: center; font-weight: 800; font-family: var(--font-head); font-size: .9rem; z-index: 2; }
.step-card .step-pill { position: absolute; top: 8px; right: 8px; }

/* ---------- Notices / Tips ---------- */
.notice {
  border-radius: var(--r-card); padding: 16px 18px; margin: 18px 0; border: 1px solid var(--border);
  background: var(--g-850); display: flex; gap: 12px; align-items: flex-start;
}
.notice.safety { background: #2E1410; border-color: var(--red-800); color: var(--red-400); }
.notice.info { background: #152530; border-color: #3A5A78; color: #A8C4D9; }
.notice.warn { background: #2E2410; border-color: #8A6A10; color: var(--note); }
.notice.neutral { background: var(--g-850); color: var(--text-2); }
.notice .notice-ico { flex: 0 0 auto; font-size: 1.2rem; line-height: 1.4; }
.notice strong { color: var(--text); }

.tip-box { border-left: 4px solid var(--o-500); background: var(--g-850); padding: 12px 16px; border-radius: 0 var(--r-card) var(--r-card) 0; margin: 16px 0; }
.tip-box.warn { border-color: var(--red-600); }
.tip-box.note { border-color: var(--info); }
.tip-box.ok { border-color: var(--ok); }
.tip-box .tip-head { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--o-300); margin-bottom: 4px; }

.legal-note { background: var(--g-850); border-left: 4px solid var(--o-500); padding: 12px 16px; font-family: var(--font-mono); font-size: .84rem; color: var(--text-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.empty-state { border: 2px dashed var(--border); border-radius: var(--r-card); padding: 36px; text-align: center; color: var(--text-3); }

.safety-strip {
  background: #2E1410; border-bottom: 1px solid var(--red-800); color: var(--red-400);
  padding: 10px 0; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em;
}
.safety-strip .container { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.safety-strip b { color: var(--red-300); }

/* Difficulty / wear indicators */
.difficulty-indicator { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .74rem; color: var(--text-2); }
.difficulty-indicator .bar { width: 80px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--ok), var(--note), var(--red-600)); }
.pad-wear-indicator { display: inline-flex; gap: 4px; }
.pad-wear-indicator span { width: 26px; height: 8px; border-radius: 2px; background: var(--g-700); }
.pad-wear-indicator .new { background: var(--ok); }
.pad-wear-indicator .worn { background: var(--note); }
.pad-wear-indicator .replace { background: var(--red-600); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-card); margin: 18px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
table.data th { background: var(--o-500); color: #1a1208; text-align: left; padding: 12px 14px; font-family: var(--font-head); font-weight: 700; letter-spacing: .02em; }
table.data td { padding: 12px 14px; border-top: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
table.data tbody tr:hover { background: var(--g-850); }
table.data td a { color: var(--o-400); }
table.data .src { font-family: var(--font-mono); font-size: .8rem; }
table.data.sortable th[data-sort] { cursor: pointer; user-select: none; }

/* ---------- Caliper-Arm Header ---------- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 200; }

/* brand bar */
.brand-bar { height: var(--brand-h); background: var(--g-950); border-bottom: 1px solid var(--o-900); display: flex; align-items: center; }
.brand-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 28px; height: 28px; border-radius: 50%; background: var(--o-500); display: grid; place-items: center; color: #1a1208; flex: 0 0 auto; }
.brand .name { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; color: var(--s-500); line-height: 1; }
.brand .tagline { font-size: .52rem; letter-spacing: .14em; text-transform: uppercase; color: var(--o-500); line-height: 1; margin-top: 2px; }
.brand-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--g-850); color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: var(--t-fast); }
.icon-btn:hover { color: var(--o-400); border-color: var(--o-500); }
.pill-3d { border: 1px solid var(--o-500); color: var(--o-400); border-radius: var(--r-pill); padding: 7px 14px; font-size: .8rem; font-weight: 700; background: transparent; cursor: pointer; transition: var(--t-fast); }
.pill-3d:hover { background: var(--o-500); color: #1a1208; }
.hamburger { display: none; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--g-850); color: var(--text); cursor: pointer; }
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text); margin: 3px auto; transition: .2s; }

/* caliper nav */
.caliper-nav { height: var(--nav-h); background: var(--g-900); border-bottom: 1px solid var(--o-900); position: relative; }
.caliper-nav .container { display: flex; align-items: center; height: 100%; }
/* the brake cable line */
.caliper-line { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--g-800); transform: translateY(-50%); z-index: 0; transition: background .2s; }
.caliper-line::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--o-700, #B8480F), transparent); opacity: 0; transition: opacity .25s; }
.caliper-nav.has-active .caliper-line::after { opacity: 1; }
.nav-list { display: flex; align-items: center; justify-content: space-between; width: 100%; list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer;
  color: var(--text-2); font-size: .9rem; font-weight: 600; background: none; border: none; font-family: var(--font-body); position: relative; transition: var(--t-fast);
}
.nav-link .node { width: 10px; height: 10px; border-radius: 50%; background: var(--g-700); transition: var(--t-fast); }
.nav-link:hover { color: var(--text); }
.nav-link:hover .node { background: var(--o-500); }
.nav-link.active { color: var(--o-500); }
.nav-link.active .node { background: var(--o-500); box-shadow: 0 0 12px rgba(232,100,31,.3); }
/* active caliper arms "clamp" inward */
.nav-item.clamp-left { transition: transform .25s ease; }
.nav-item.clamp-right { transition: transform .25s ease; }
.caliper-nav.has-active .nav-item.clamp-left { transform: translateX(2px); }
.caliper-nav.has-active .nav-item.clamp-right { transform: translateX(-2px); }

/* dropdown */
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
  background: var(--g-850); border: 1px solid var(--border); border-top: 2px solid var(--o-500);
  border-radius: var(--r-card); box-shadow: var(--sh-lg); padding: 8px; display: none; z-index: 50;
}
.nav-item.has-dropdown:hover .nav-dropdown, .nav-item.has-dropdown.open .nav-dropdown { display: block; }
.nav-dropdown a { display: block; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: .88rem; }
.nav-dropdown a:hover { background: var(--g-900); color: var(--o-400); }
.nav-dropdown a b { color: var(--text); font-family: var(--font-mono); font-size: .7rem; display: block; }

/* mobile drawer */
.nav-drawer { position: fixed; top: calc(var(--brand-h) + var(--nav-h)); left: 0; right: 0; bottom: 0; background: var(--g-950); z-index: 180; transform: translateX(100%); transition: transform .28s ease; overflow-y: auto; padding: 16px; }
.nav-drawer.open { transform: translateX(0); }
.nav-drawer .drawer-link { display: flex; align-items: center; gap: 12px; padding: 14px 12px; color: var(--text); border-bottom: 1px solid var(--border); font-size: 1rem; }
.nav-drawer .drawer-link .node { width: 10px; height: 10px; border-radius: 50%; background: var(--g-700); }
.nav-drawer .drawer-link.active { color: var(--o-500); }
.nav-drawer .drawer-sub { padding: 8px 0 8px 22px; }
.nav-drawer .drawer-sub a { display: block; padding: 8px 0; color: var(--text-2); }

/* search overlay */
.search-overlay { position: fixed; inset: 0; background: rgba(8,8,10,.92); z-index: 300; display: none; padding: 80px 20px; }
.search-overlay.open { display: block; }
.search-box { max-width: 600px; margin: 0 auto; }
.search-box input { width: 100%; padding: 16px 18px; font-size: 1.1rem; border-radius: var(--r-card); border: 2px solid var(--o-500); background: var(--g-900); color: var(--text); font-family: var(--font-body); }
.search-results { margin-top: 16px; display: grid; gap: 10px; }
.search-close { position: absolute; top: 24px; right: 24px; background: none; border: none; color: var(--text-2); font-size: 2rem; cursor: pointer; }

/* ---------- Page hero (.page-hero) ---------- */
.page-hero { background: var(--g-900); border-bottom: 3px solid var(--o-500); position: relative; overflow: hidden; padding: 48px 0; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, var(--metal-grain) 0 2px, transparent 2px 6px); pointer-events: none; }
.page-hero .container { position: relative; z-index: 1; }
.breadcrumb { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--o-400); }
.page-hero .lead { color: var(--text-2); max-width: 64ch; font-size: 1.05rem; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; min-height: 440px; display: flex; align-items: center; background: var(--g-900); overflow: hidden; border-bottom: 3px solid var(--o-500); }
.hero::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, var(--metal-grain) 0 2px, transparent 2px 6px), radial-gradient(circle at 80% 30%, rgba(232,100,31,.10), transparent 50%); }
.hero::after { content: ""; position: absolute; right: -10%; top: -20%; width: 60%; height: 140%; background: repeating-radial-gradient(circle at 50% 50%, var(--rubber-grain) 0 3px, transparent 3px 9px); transform: rotate(8deg); }
.hero .container { position: relative; z-index: 2; }
.hero-kicker { display: inline-block; background: var(--o-500); color: #1a1208; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 6px 14px; border-radius: var(--r-pill); margin-bottom: 18px; }
.hero h1 { font-size: clamp(1.95rem, 4.2vw, 2.9rem); max-width: 18ch; }
.hero p.lead { color: var(--text-2); font-size: 1.15rem; max-width: 52ch; margin-bottom: 26px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* trust bar */
.trust-bar { background: var(--g-850); border-bottom: 1px solid var(--border); }
.trust-bar .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); padding: 28px var(--gutter); }
.trust-item { text-align: center; }
.trust-item .ti-ico { color: var(--o-500); font-size: 1.6rem; }
.trust-item h4 { font-family: var(--font-head); margin: 8px 0 4px; }
.trust-item p { color: var(--text-3); font-size: .86rem; margin: 0; }
@media (max-width: 640px) { .trust-bar .container { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--g-950); border-top: 1px solid var(--o-900); padding: 48px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 28px; }
.footer-col h4 { font-family: var(--font-head); font-size: .95rem; color: var(--text); margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--text-2); font-size: .9rem; }
.footer-col a:hover { color: var(--o-400); }
.footer-brand .name { font-family: var(--font-head); font-weight: 700; color: var(--s-500); font-size: 1.1rem; }
.footer-brand p { color: var(--text-3); font-size: .86rem; }
.footer-icons { display: flex; gap: 10px; margin: 12px 0; }
.footer-icons .fi { width: 34px; height: 34px; border-radius: 50%; background: var(--g-850); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); }
.subscribe { display: flex; gap: 8px; margin-top: 10px; }
.subscribe input { flex: 1; padding: 9px 12px; background: var(--g-850); border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--text); font-family: var(--font-body); }
.subscribe input:focus { outline: none; border-color: var(--o-500); }
.footer-disclaimer { background: var(--g-900); border: 1px solid var(--o-800); border-radius: var(--r-card); padding: 16px 18px; margin: 28px 0; display: flex; gap: 14px; align-items: flex-start; }
.footer-disclaimer .shield { font-size: 1.6rem; color: var(--o-500); flex: 0 0 auto; }
.footer-disclaimer p { margin: 0; font-size: .84rem; color: var(--text-2); }
.footer-disclaimer b { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 18px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--text-3); }
.footer-bottom .links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom a { color: var(--text-3); }
.footer-bottom a:hover { color: var(--o-400); }
.test-badge { background: var(--o-500); color: #1a1208; font-weight: 800; font-size: .7rem; letter-spacing: .1em; padding: 4px 10px; border-radius: var(--r-pill); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Step figure (article micro-animation) ---------- */
.step-figure { background: var(--g-850); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; margin: 22px 0; }
.step-figure .step-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.step-figure .step-label { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; color: var(--o-300); }
.step-figure .step-stage { position: relative; aspect-ratio: 16/9; background: radial-gradient(circle at 50% 40%, var(--g-800), var(--g-950)); display: grid; place-items: center; overflow: hidden; }
.step-figure .step-caption { padding: 14px 16px; border-top: 1px solid var(--border); }
.step-figure .step-caption p { margin: 0; color: var(--text); }
.step-figure figcaption .step-number { color: var(--o-500); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; }
.step-nav { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 12px; border-top: 1px solid var(--border); }
.step-anim-layer { position: absolute; inset: 0; pointer-events: none; }
.hotspot { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--o-400); background: rgba(232,100,31,.25); transform: translate(-50%, -50%); }
.hotspot.pulse { animation: hs-pulse 1.6s ease-in-out infinite; }
.hotspot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--o-400); opacity: .5; }

/* error demo figure */
.error-figure { border: 2px solid var(--red-600); }
.error-figure .step-caption p { color: var(--red-400); }

/* ---------- Calculators ---------- */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); align-items: start; }
@media (max-width: 840px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-panel { background: var(--g-850); border: 1px solid var(--border); border-radius: var(--r-card); padding: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field input, .field select { width: 100%; padding: 10px 12px; background: var(--g-900); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); font-family: var(--font-body); font-size: .95rem; }
.field input:focus, .field select:focus { outline: none; border-color: var(--o-500); }
.field .hint { font-size: .76rem; color: var(--text-3); margin-top: 4px; }
.result-box { background: var(--g-900); border: 1px solid var(--o-800); border-radius: var(--r-card); padding: 18px; }
.result-box h4 { color: var(--o-300); font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.result-val { font-family: var(--font-mono); font-size: 1.8rem; color: var(--text); font-weight: 700; }
.result-note { font-size: .88rem; color: var(--text-2); }

/* ---------- Teardown (3D) ---------- */
.teardown-wrap { display: grid; grid-template-columns: 1fr 320px; gap: var(--gutter); }
@media (max-width: 960px) { .teardown-wrap { grid-template-columns: 1fr; } }
.stage-3d { position: relative; aspect-ratio: 4/3; background: radial-gradient(circle at 50% 40%, var(--g-800), var(--g-950)); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.stage-3d canvas { display: block; width: 100%; height: 100%; }
.stage-3d .overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.stage-3d .skeleton { width: 60%; height: 60%; border: 2px dashed var(--border-strong); border-radius: 12px; display: grid; place-items: center; color: var(--text-3); }
.teardown-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.layer-info { background: var(--g-850); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px; }
.layer-info h3 { color: var(--o-300); }
.layer-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.layer-list li { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; display: flex; align-items: center; gap: 10px; transition: var(--t-fast); }
.layer-list li:hover { border-color: var(--o-500); }
.layer-list li.active { border-color: var(--o-500); background: var(--g-900); }
.layer-list li .swatch { width: 14px; height: 14px; border-radius: 3px; }

/* ---------- Misc ---------- */
.toc { background: var(--g-850); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px 20px; margin: 20px 0; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; }
.toc a { color: var(--text-2); }
.toc a:hover { color: var(--o-400); }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; border-bottom: 1px solid var(--border); padding-bottom: .2em; }
.featured-post { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--gutter); background: var(--g-850); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
@media (max-width: 760px) { .featured-post { grid-template-columns: 1fr; } }
.featured-post .fp-media { min-height: 220px; background: radial-gradient(circle at 40% 40%, var(--g-800), var(--g-950)); display: grid; place-items: center; }
.featured-post .fp-body { padding: 22px; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.hscroll-tags { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 14px; scroll-snap-type: x mandatory; }
.hscroll-tags .discuss-tag { scroll-snap-align: start; flex: 0 0 auto; }
.discuss-tag { text-decoration: none; }
.cta-band { background: linear-gradient(135deg, var(--o-500), var(--o-800)); border-radius: var(--r-cta); padding: 28px; margin: 30px 0; position: relative; overflow: hidden; color: #1a1208; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, var(--metal-grain) 0 2px, transparent 2px 6px); }
.cta-band .container, .cta-band > * { position: relative; z-index: 1; }
.cta-band h3 { color: #1a1208; }
.cta-band p { color: #2a1505; }

/* progress bar */
.progress { height: 4px; background: var(--g-850); border-radius: 2px; overflow: hidden; margin: 8px 0; }
.progress .bar { height: 100%; background: var(--o-500); width: 0; transition: width .3s; }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
