/* =========================================================
   Thermal Expansion Mod — fan guide site
   Design seed: S14 Mod Workshop Light
   Palette: Thermal Expansion logo colours (light only)
   ========================================================= */

:root {
  /* Palette sampled from the Thermal Expansion logo:
     redstone #B51509, deep redstone #6A0000, crimson #8F2838,
     gold #FFC55C, orange #FFAA54, ember #F7563E, cream #F3E592,
     stone brown #7D5547, plum #5B3A40, charcoal #302F33 */
  --page: #f6f4f3;
  --surface: #ffffff;
  --mist: #eee8e6;
  --mist-strong: #e4dad7;
  --line: #d8cbc7;
  --line-soft: #e9e1de;
  --ink: #302f33;
  --ink-soft: #4f474a;
  --ink-muted: #6b6064;
  --redstone: #b51509;
  --redstone-deep: #6a0000;
  --redstone-tint: #fbe6e2;
  --plum: #5b3a40;
  --plum-tint: #f0e8e9;
  --brown: #7d5547;
  --molten: #ffaa54;
  --molten-hi: #ffc55c;
  --molten-deep: #f7563e;
  --molten-ink: #8f2838;
  --molten-tint: #fff1dc;
  --cream: #f3e592;
  --ok: #1d7a4a;
  --warn: #9a5a0b;
  --no: #8f2838;

  --font: "Poppins", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --shadow-plate: 0 1px 0 rgba(48, 47, 51, 0.06), 0 6px 18px -10px rgba(106, 0, 0, 0.28);
  --shadow-lift: 0 14px 30px -18px rgba(48, 47, 51, 0.4);

  --wrap: 1180px;
  --wrap-narrow: 860px;
  --header-h: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page);
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--redstone); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--redstone-deep); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }

:focus-visible {
  outline: 3px solid var(--redstone);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 16px;
  border: 2px solid var(--redstone);
  border-radius: var(--r-sm);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 40px, var(--wrap-narrow)); margin-inline: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  font: 600 0.98rem/1.2 var(--font);
  text-decoration: none;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--molten-hi) 0%, var(--molten) 100%);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--molten-deep);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffd27a 0%, var(--molten-hi) 100%); color: var(--ink); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--molten-deep); }
.btn-outline {
  background: var(--surface);
  color: var(--redstone-deep);
  border-color: var(--redstone);
}
.btn-outline:hover { background: var(--redstone-tint); color: var(--redstone-deep); }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 1.05rem; }

/* ---------- Header: workbench toolbar ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}
#site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 24px);
  opacity: 0.8;
  pointer-events: none;
}
#site-header.is-scrolled { box-shadow: 0 8px 22px -18px rgba(48, 47, 51, 0.5); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand img { width: auto; height: 46px; }
.footer-brand .brand img { height: 72px; }
.brand:hover { color: var(--ink); }

.nav-groups {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 6px;
}
.nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--page);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.nav-group a {
  display: block;
  padding: 7px 11px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: var(--r-xs);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-group a:hover { background: var(--surface); color: var(--ink); }
.nav-group a.is-active,
.nav-group a[aria-current="page"] {
  background: var(--surface);
  color: var(--redstone-deep);
  box-shadow: inset 0 -2px 0 var(--redstone), 0 1px 2px rgba(48, 47, 51, 0.08);
}
.header-cta { min-height: 42px; padding: 9px 16px; font-size: 0.92rem; }

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.menu-toggle span::before,
.menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Generic section scaffolding ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; position: relative; }
.section-tight { padding: clamp(48px, 7vw, 80px) 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--redstone);
  margin-bottom: 12px;
}
.kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--molten);
}
.bg-surface { background: var(--surface); }
.bg-mist { background: var(--mist); }
.bg-grid {
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---------- Hero: mod assembly ---------- */
.hero {
  position: relative;
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(circle at 78% 40%, rgba(181, 21, 9, 0.07), transparent 55%),
    var(--page);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(216, 203, 199, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 203, 199, 0.55) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, transparent 30%, #000 70%);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.hero-copy h1 { max-width: 12ch; margin-bottom: 0.45em; }
.hero-lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 26px; }
.spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  max-width: 470px;
}
.spec-tags li {
  flex: 1 1 auto;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.35;
  border-right: 1px solid var(--line-soft);
}
.spec-tags li:last-child { border-right: 0; }
.spec-tags strong { display: block; font-size: 0.95rem; color: var(--ink); }
.spec-tags span { color: var(--ink-muted); }

.assembly {
  position: relative;
  aspect-ratio: 1.12 / 1;
}
.assembly > img { width: 100%; height: 100%; object-fit: contain; }
.part-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 9px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--redstone);
  border-radius: var(--r-xs);
  box-shadow: var(--shadow-plate);
  white-space: nowrap;
  animation: drift 7s ease-in-out infinite;
}
.part-label i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--molten);
  box-shadow: 0 0 0 3px var(--molten-tint);
}
.part-label.p1 { top: 7%; left: 2%; }
.part-label.p2 { top: 20%; right: 0; animation-delay: -2s; }
.part-label.p3 { bottom: 26%; left: 0; animation-delay: -4s; border-left-color: var(--molten); }
.part-label.p4 { bottom: 6%; right: 8%; animation-delay: -1s; border-left-color: var(--plum); }
@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- About: workbench explanation ---------- */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 230px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.workbench > * { padding: clamp(24px, 3vw, 40px); }
.wb-main h2 { max-width: 16ch; }
.wb-main p { color: var(--ink-soft); }
.wb-breakdown {
  background: var(--page);
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}
.wb-breakdown figure { margin: 0 0 18px; }
.parts-list { list-style: none; margin: 0; padding: 0; position: relative; }
.parts-list::before {
  content: "";
  position: absolute;
  left: 11px; top: 14px; bottom: 14px;
  border-left: 2px dashed var(--line);
}
.parts-list li { position: relative; padding: 0 0 16px 38px; }
.parts-list li:last-child { padding-bottom: 0; }
.parts-list li::before {
  content: "";
  position: absolute;
  left: 3px; top: 6px;
  width: 18px; height: 18px;
  border-radius: 4px;
  background: var(--surface);
  border: 2px solid var(--redstone);
}
.parts-list li.core::before { background: var(--molten); border-color: var(--molten-ink); }
.parts-list strong { display: block; font-size: 0.98rem; }
.parts-list span { font-size: 0.9rem; color: var(--ink-soft); }
.spec-rail { background: var(--redstone-tint); }
.spec-rail h3 { font-size: 0.95rem; color: var(--redstone-deep); }
.spec-rail dl { margin: 0; }
.spec-rail dt { font-size: 0.78rem; color: var(--ink-muted); margin-top: 14px; }
.spec-rail dd { margin: 2px 0 0; font-weight: 600; font-size: 0.95rem; line-height: 1.4; }

/* ---------- Features: assembly board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(120px, auto);
  gap: 14px;
  position: relative;
}
.mod {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 22px 22px 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.mod:hover { border-color: var(--redstone); }
.mod h3 { font-size: 1.05rem; margin-bottom: 0.4em; }
.mod p { font-size: 0.93rem; color: var(--ink-soft); margin: 0; }
.mod .ico {
  width: 40px; height: 40px;
  margin-bottom: 14px;
  color: var(--redstone);
}
.mod::after {
  content: "";
  position: absolute;
  top: 10px; right: 10px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-soft);
}
.mod-core {
  grid-column: 4 / span 6;
  grid-row: 1 / span 2;
  background: linear-gradient(160deg, var(--surface) 0%, var(--redstone-tint) 100%);
  border: 2px solid var(--redstone);
  padding: clamp(24px, 3vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.mod-core h3 { font-size: 1.5rem; }
.mod-core p { font-size: 1rem; }
.mod-core .machine-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  list-style: none; padding: 0; margin: 18px 0 0;
}
.mod-core .machine-chips li {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
}
.mod-a { grid-column: 1 / span 3; grid-row: 1 / span 1; }
.mod-b { grid-column: 1 / span 3; grid-row: 2 / span 2; border-left: 3px solid var(--molten); }
.mod-c { grid-column: 10 / span 3; grid-row: 1 / span 2; }
.mod-d { grid-column: 4 / span 3; grid-row: 3 / span 1; }
.mod-e { grid-column: 7 / span 6; grid-row: 3 / span 1; display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; background: var(--page); }
.mod-e .ico { margin: 0; }
.board-bolts { position: absolute; inset: 0; pointer-events: none; }

/* ---------- How it works: assembly line ---------- */
.line-wrap { position: relative; }
.conveyor {
  position: absolute;
  left: 4%; right: 4%;
  top: 46px;
  height: 14px;
  border-radius: 7px;
  background: var(--mist);
  border: 1px solid var(--line);
  overflow: hidden;
}
.conveyor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 18px, var(--line) 18px 20px);
  animation: belt 3s linear infinite;
}
@keyframes belt { to { transform: translateX(20px); } }
.stations {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  position: relative;
}
.station { position: relative; text-align: left; }
.station-num {
  width: 104px; height: 104px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--redstone-deep);
  background: var(--surface);
  border: 2px solid var(--redstone);
  border-radius: var(--r-md);
  position: relative;
}
.station:nth-child(2) .station-num { border-radius: 50%; }
.station:nth-child(3) .station-num { transform: rotate(45deg) scale(0.86); }
.station:nth-child(3) .station-num span { transform: rotate(-45deg); }
.station:nth-child(4) .station-num { background: var(--molten); border-color: var(--molten-ink); color: var(--ink); }
.station h3 { margin-bottom: 0.35em; }
.station p { font-size: 0.94rem; color: var(--ink-soft); margin: 0; }

/* ---------- Installation: procedure ---------- */
.setup-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.prep-card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  background: var(--surface);
  border: 1px dashed var(--redstone);
  border-radius: var(--r-sm);
  padding: 24px;
}
.prep-card h3 { font-size: 1.05rem; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative;
  padding: 8px 0 8px 30px;
  font-size: 0.93rem;
  border-bottom: 1px solid var(--line-soft);
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 12px;
  width: 16px; height: 16px;
  border: 2px solid var(--redstone);
  border-radius: 3px;
  background:
    linear-gradient(45deg, transparent 45%, var(--redstone) 45% 60%, transparent 60%) no-repeat 3px 6px / 5px 4px,
    linear-gradient(-45deg, transparent 40%, var(--redstone) 40% 58%, transparent 58%) no-repeat 6px 2px / 6px 8px;
}
.procedure { counter-reset: proc; list-style: none; margin: 0; padding: 0; }
.procedure > li {
  counter-increment: proc;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  padding: 0 0 30px;
  position: relative;
}
.procedure > li::before {
  content: counter(proc);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid var(--plum);
  border-radius: var(--r-xs);
  color: var(--plum);
  position: relative;
  z-index: 1;
}
.procedure > li::after {
  content: "";
  position: absolute;
  left: 21px; top: 46px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.procedure > li:last-child::after { display: none; }
.procedure h3 { margin: 8px 0 0.35em; }
.procedure p { color: var(--ink-soft); margin: 0; }
.note-inline {
  margin-top: 10px;
  font-size: 0.88rem;
  padding: 10px 14px;
  background: var(--molten-tint);
  border-left: 3px solid var(--molten);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

/* ---------- Compatibility: matrix ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.matrix { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 0.94rem; }
.matrix caption { text-align: left; padding: 14px 18px; font-size: 0.86rem; color: var(--ink-muted); caption-side: bottom; border-top: 1px solid var(--line-soft); }
.matrix th, .matrix td { text-align: left; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.matrix thead th { background: var(--plum-tint); font-size: 0.85rem; font-weight: 600; color: var(--plum); }
.matrix tbody th { font-weight: 600; width: 26%; }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.86rem;
  white-space: nowrap;
}
.status::before { content: ""; width: 10px; height: 10px; border-radius: 2px; }
.status.ok { color: var(--ok); }
.status.ok::before { background: var(--ok); }
.status.check { color: var(--warn); }
.status.check::before { background: var(--warn); border-radius: 50%; }
.status.no { color: var(--no); }
.status.no::before { background: transparent; border: 2px solid var(--no); }
.compat-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.compat-head .section-head { margin: 0; }

/* ---------- Release information: spec plate ---------- */
.release {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.plate {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  position: relative;
  padding: 8px 26px;
}
.plate::before, .plate::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--mist-strong);
  border: 1px solid var(--line);
  top: 12px;
}
.plate::before { left: 10px; }
.plate::after { right: 10px; }
.plate dl { margin: 0; }
.plate .row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.plate .row:last-child { border-bottom: 0; }
.plate dt { font-size: 0.86rem; color: var(--ink-muted); }
.plate dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ---------- Use cases: alternating ledger ---------- */
.uses { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.uses li {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.uses li:nth-child(even) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr); }
.uses li:nth-child(even) h3 { order: 2; text-align: right; }
.uses h3 { font-size: 1.25rem; margin: 0; }
.uses p { margin: 0; color: var(--ink-soft); }

/* ---------- Download: full-width band ---------- */
.download-band {
  background:
    linear-gradient(90deg, rgba(181, 21, 9, 0.06) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(135deg, #ffffff 0%, var(--molten-tint) 55%, var(--redstone-tint) 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.download-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.download-panel {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  padding: clamp(24px, 3.5vw, 40px);
  box-shadow: 8px 8px 0 var(--redstone-tint);
}
.download-panel h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.dl-facts { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.dl-facts li { font-size: 0.88rem; color: var(--ink-soft); }
.dl-facts strong { display: block; color: var(--ink); font-size: 0.95rem; }
.dl-note { font-size: 0.86rem; color: var(--ink-muted); margin: 18px 0 0; }

/* ---------- Troubleshooting: reference rows ---------- */
.diag { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.diag-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
  align-items: start;
}
.diag-row:last-child { border-bottom: 0; }
.diag-row .code {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--molten-ink);
  background: var(--molten-tint);
  border-radius: var(--r-xs);
  text-align: center;
  padding: 4px 0;
}
.diag-row h3 { font-size: 1rem; margin: 0; }
.diag-row p { margin: 0; font-size: 0.94rem; color: var(--ink-soft); }
.diag-head { background: var(--plum-tint); font-size: 0.82rem; font-weight: 600; color: var(--plum); padding-top: 12px; padding-bottom: 12px; }

/* ---------- Guides preview ---------- */
.guide-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 22px;
}
.guide-feature {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.guide-feature:hover { border-color: var(--redstone); box-shadow: var(--shadow-lift); color: var(--ink); }
.guide-feature img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line-soft); }
.guide-feature .gbody { padding: 22px 24px 26px; }
.guide-feature h3 { font-size: 1.3rem; }
.guide-feature p { color: var(--ink-soft); margin: 0; }
.meta-strip {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.meta-strip .tag {
  font-weight: 600;
  color: var(--redstone-deep);
  background: var(--redstone-tint);
  padding: 2px 8px;
  border-radius: var(--r-xs);
}
.meta-strip .tag.fix { color: var(--molten-ink); background: var(--molten-tint); }
.guide-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.guide-list a {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.guide-list a:hover { border-color: var(--redstone); color: var(--ink); }
.guide-list img { width: 92px; height: 60px; object-fit: cover; border-radius: var(--r-xs); border: 1px solid var(--line-soft); }
.guide-list h3 { font-size: 0.98rem; margin: 0 0 2px; }
.guide-list span { font-size: 0.8rem; color: var(--ink-muted); }
.all-guides { margin-top: 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- Pros & cons: ledger ---------- */
.ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.ledger > div { padding: clamp(22px, 3vw, 36px); }
.ledger > div + div { border-left: 1px dashed var(--line); }
.ledger h3 { display: flex; align-items: center; gap: 10px; }
.ledger h3::before {
  content: "+";
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  background: var(--redstone-tint);
  color: var(--redstone-deep);
  font-weight: 700;
}
.ledger .cons h3::before { content: "\2212"; background: var(--molten-tint); color: var(--molten-ink); }
.ledger ul { margin: 0; padding: 0; list-style: none; }
.ledger li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 0.95rem; }
.ledger li:last-child { border-bottom: 0; }

/* ---------- Safety notice: typographic ---------- */
.safety { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.safety-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: clamp(24px, 5vw, 80px);
}
.safety h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.safety-text p { font-size: 1.08rem; color: var(--ink-soft); max-width: 62ch; }
.safety-text p:first-child { font-size: 1.25rem; color: var(--ink); font-weight: 500; line-height: 1.55; }

/* ---------- FAQ: workshop manual with tool-group tabs ---------- */
.manual {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.manual-intro p { color: var(--ink-soft); font-size: 0.95rem; }
.tool-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0;
}
.tool-tab {
  font: 600 0.95rem/1.2 var(--font);
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--mist);
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  margin-right: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tool-tab .count {
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1px 8px;
}
.tool-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 0 3px 0 var(--molten);
  position: relative;
  top: 2px;
  padding-bottom: 16px;
}
.tool-panel { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r-sm) var(--r-sm); }
.tool-panel[hidden] { display: none; }
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-item:last-child { border-bottom: 0; }
.faq-item h3 { margin: 0; font-size: 1rem; }
.faq-q {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 22px;
  gap: 14px;
  align-items: center;
  padding: 18px 22px;
  background: none;
  border: 0;
  text-align: left;
  font: 600 1rem/1.45 var(--font);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.faq-q:hover { background: var(--page); }
.faq-q .idx { font-size: 0.78rem; font-weight: 600; color: var(--ink-muted); }
.faq-q .led {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  justify-self: end;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-q[aria-expanded="true"] { background: var(--page); }
.faq-q[aria-expanded="true"] .led {
  background: var(--molten);
  border-color: var(--molten-ink);
  box-shadow: 0 0 0 4px var(--molten-tint);
}
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}
.faq-a > div { overflow: hidden; }
.faq-a p { margin: 0; padding: 0 22px 20px 66px; color: var(--ink-soft); font-size: 0.95rem; }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }

/* ---------- Footer: utility workshop ---------- */
#site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
#site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
  opacity: 0.6;
  pointer-events: none;
}
.footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding: 56px 0 36px;
}
.footer-brand p { color: var(--ink-soft); font-size: 0.92rem; max-width: 38ch; margin-top: 14px; }
.footer-col h2 { font-size: 0.92rem; font-weight: 600; margin-bottom: 12px; color: var(--plum); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: var(--redstone); text-decoration: underline; }
.plain-email { font-size: 0.92rem; font-weight: 500; color: var(--ink); user-select: all; }
.footer-bottom {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 26px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.footer-bottom a { color: var(--ink); text-decoration: none; font-weight: 600; }
.footer-bottom a:hover { color: var(--redstone); }

/* ---------- Scroll-to-top ---------- */
.to-top {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 90;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--surface);
  color: var(--redstone-deep);
  border: 2px solid var(--redstone);
  border-radius: var(--r-sm);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--redstone-tint); }
.to-top svg { width: 20px; height: 20px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* =========================================================
   Inner pages
   ========================================================= */
.page-head {
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: relative;
}
.page-head::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 16px);
}
.crumbs { font-size: 0.85rem; color: var(--ink-muted); margin-bottom: 14px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--redstone); text-decoration: underline; }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); max-width: 22ch; }
.page-head .lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 60ch; margin: 0; }

.prose { font-size: 1.02rem; }
.prose h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose p, .prose li { color: #3d3639; }
.prose li { margin-bottom: 0.45em; }
.prose code { font-size: 0.9em; background: var(--mist); padding: 2px 6px; border-radius: var(--r-xs); }
.prose pre { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--redstone); padding: 14px 16px; overflow-x: auto; border-radius: var(--r-xs); }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.prose th { background: var(--plum-tint); color: var(--plum); font-weight: 600; }
.callout {
  margin: 1.6em 0;
  padding: 16px 20px;
  background: var(--molten-tint);
  border-left: 4px solid var(--molten);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout.info { background: var(--redstone-tint); border-left-color: var(--redstone); }

/* About page */
.about-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.principles { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.principles li { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.principles li:last-child { border-bottom: 0; }
.principles strong { display: block; margin-bottom: 2px; }
.principles span { font-size: 0.93rem; color: var(--ink-soft); }

/* Contact page */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.email-plate {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  padding: 30px;
  box-shadow: 8px 8px 0 var(--mist-strong);
}
.email-plate .plain-email { font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 600; display: block; margin: 6px 0 14px; word-break: break-all; }
.reasons { list-style: none; margin: 0; padding: 0; }
.reasons li { padding: 14px 0 14px 34px; position: relative; border-bottom: 1px solid var(--line-soft); }
.reasons li::before { content: ""; position: absolute; left: 0; top: 20px; width: 16px; height: 3px; background: var(--redstone); }

/* Legal pages */
.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}
.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  font-size: 0.9rem;
  border-left: 2px solid var(--line);
  padding-left: 16px;
}
.legal-toc h2 { font-size: 0.9rem; color: var(--plum); margin-bottom: 10px; }
.legal-toc ol { margin: 0; padding-left: 1.1em; }
.legal-toc li { margin-bottom: 6px; }
.legal-toc a { color: var(--ink-soft); text-decoration: none; }
.legal-toc a:hover { color: var(--redstone); text-decoration: underline; }
.updated { font-size: 0.88rem; color: var(--ink-muted); }
.legal-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--molten);
  border-radius: var(--r-sm);
  margin-bottom: 28px;
}
.legal-banner svg { width: 34px; height: 34px; color: var(--molten-ink); }
.legal-banner p { margin: 0; }
.terms-list { counter-reset: term; list-style: none; padding: 0; margin: 0; }
.terms-list > li { counter-increment: term; padding: 22px 0 22px 64px; position: relative; border-bottom: 1px solid var(--line-soft); }
.terms-list > li::before {
  content: counter(term);
  position: absolute; left: 0; top: 22px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-weight: 700; color: var(--redstone-deep);
  border: 2px solid var(--redstone);
  border-radius: var(--r-xs);
}
.terms-list h2 { font-size: 1.15rem; margin: 6px 0 0.4em; }
.terms-list p { margin: 0 0 0.6em; color: var(--ink-soft); }

/* Blog listing: knowledge board */
.kb-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
}
.kb-legend { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.kb-legend span {
  font-size: 0.85rem; font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface);
}
.kb-legend .l-setup { border-left: 4px solid var(--molten); }
.kb-legend .l-play { border-left: 4px solid var(--redstone); }
.kb-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 48px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.kb-featured:hover { border-color: var(--redstone); box-shadow: var(--shadow-lift); color: var(--ink); }
.kb-featured img { width: 100%; height: 100%; object-fit: cover; }
.kb-featured .fbody { padding: clamp(24px, 3.5vw, 44px); display: flex; flex-direction: column; justify-content: center; }
.kb-featured h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.kb-featured p { color: var(--ink-soft); }
.kb-board {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: 36px;
}
.kb-board-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--page);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.kb-board-head h2 { font-size: 1.2rem; margin: 0; }
.kb-board-head p { margin: 0; font-size: 0.9rem; color: var(--ink-muted); }
.kb-board.setup { border-top: 4px solid var(--molten); }
.kb-board.play { border-top: 4px solid var(--redstone); }
.kb-rows { list-style: none; margin: 0; padding: 0; }
.kb-rows a {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  transition: background-color 0.15s ease;
}
.kb-rows li:last-child a { border-bottom: 0; }
.kb-rows a:hover { background: var(--page); color: var(--ink); }
.kb-rows img { width: 168px; height: 95px; object-fit: cover; border: 1px solid var(--line-soft); border-radius: var(--r-xs); }
.kb-rows h3 { font-size: 1.08rem; margin: 0 0 4px; }
.kb-rows p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.kb-rows .go { font-size: 0.85rem; font-weight: 600; color: var(--redstone); white-space: nowrap; }
.kb-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.kb-tiles a {
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px 24px;
  text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.15s ease;
}
.kb-tiles a:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.kb-tiles a:hover { background: var(--page); color: var(--ink); }
.kb-tiles img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: var(--r-xs); border: 1px solid var(--line-soft); }
.kb-tiles h3 { font-size: 1.08rem; margin: 0; }
.kb-tiles p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }

/* Blog post */
.post-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: clamp(36px, 5vw, 60px) 0 0;
}
.post-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); max-width: 24ch; }
.post-head .lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; }
.post-hero { margin: 28px 0 -1px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-md) var(--r-md) 0 0; overflow: hidden; }
.post-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding: clamp(36px, 5vw, 56px) 0 clamp(56px, 8vw, 96px);
}
.post-body { max-width: 72ch; }
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 18px; }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 20px; }
.side-box h2 { font-size: 0.98rem; margin-bottom: 10px; }
.side-box ol, .side-box ul { margin: 0; padding-left: 1.1em; font-size: 0.9rem; }
.side-box li { margin-bottom: 6px; }
.side-box a { color: var(--ink-soft); text-decoration: none; }
.side-box a:hover { color: var(--redstone); text-decoration: underline; }
.side-box.spec dl { margin: 0; font-size: 0.88rem; }
.side-box.spec dt { color: var(--ink-muted); margin-top: 8px; }
.side-box.spec dd { margin: 0; font-weight: 600; }
.side-box.dl { border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--redstone-tint); }
.side-box.dl p { font-size: 0.9rem; color: var(--ink-soft); }
.side-box.dl .btn { width: 100%; }
.related { margin-top: 48px; padding-top: 28px; border-top: 2px solid var(--ink); }
.related h2 { font-size: 1.25rem; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.related a {
  display: block; height: 100%;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
}
.related a span { display: block; font-weight: 400; font-size: 0.82rem; color: var(--ink-muted); margin-top: 6px; }
.related a:hover { border-color: var(--redstone); color: var(--ink); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1120px) {
  .nav-group a { padding: 7px 8px; font-size: 0.84rem; }
  .workbench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .spec-rail { grid-column: 1 / -1; }
  .spec-rail dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; }
  .wb-breakdown { border-right: 0; }
}

@media (max-width: 980px) {
  :root { --header-h: 66px; }
  .menu-toggle { display: inline-flex; }
  .nav-wrap {
    position: fixed;
    left: 0; right: 0;
    top: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px -24px rgba(48, 47, 51, 0.5);
    padding: 16px 20px 22px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }
  .nav-wrap.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-groups { flex-direction: column; align-items: stretch; gap: 10px; margin: 0; }
  .nav-group { flex-direction: column; align-items: stretch; padding: 6px; }
  .nav-group a { padding: 11px 12px; font-size: 0.98rem; }
  .header-cta { margin-top: 6px; width: 100%; min-height: 50px; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: 16ch; }
  .assembly { max-width: 620px; margin-inline: auto; width: 100%; }

  .board { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mod-core { grid-column: 1 / -1; grid-row: auto; }
  .mod-a, .mod-b, .mod-c, .mod-d { grid-column: span 3; grid-row: auto; }
  .mod-e { grid-column: 1 / -1; grid-row: auto; }

  .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .conveyor { display: none; }

  .setup-grid, .release, .download-grid, .guide-strip, .safety-grid, .manual,
  .about-split, .contact-layout, .legal-layout, .kb-intro, .kb-featured, .post-layout { grid-template-columns: 1fr; }
  .prep-card, .legal-toc, .sidebar { position: static; }
  .kb-legend { justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  body { font-size: 0.98rem; }
  .workbench { grid-template-columns: 1fr; }
  .wb-breakdown { border-left: 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
  .spec-rail dl { grid-template-columns: 1fr 1fr; }
  .board { grid-template-columns: 1fr; }
  .mod-a, .mod-b, .mod-c, .mod-d, .mod-e, .mod-core { grid-column: 1 / -1; }
  .mod-e { grid-template-columns: 1fr; }
  .stations { grid-template-columns: 1fr; }
  .station { display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: start; }
  .station-num { width: 64px; height: 64px; font-size: 1.4rem; margin: 0; }
  .uses li, .uses li:nth-child(even) { grid-template-columns: 1fr; gap: 8px; }
  .uses li:nth-child(even) h3 { order: 0; text-align: left; }
  .plate .row { grid-template-columns: 1fr; gap: 2px; }
  .diag-row { grid-template-columns: 48px 1fr; }
  .diag-row p { grid-column: 2; }
  .diag-head { display: none; }
  .ledger { grid-template-columns: 1fr; }
  .ledger > div + div { border-left: 0; border-top: 1px dashed var(--line); }
  .dl-facts { grid-template-columns: 1fr; }
  .tool-tab { padding: 12px 12px; font-size: 0.86rem; flex: 1; justify-content: center; margin-right: 4px; }
  .tool-tab .count { display: none; }
  .faq-q { grid-template-columns: 24px minmax(0, 1fr) 16px; padding: 16px; gap: 10px; }
  .faq-a p { padding: 0 16px 18px 50px; }
  .spec-tags li { flex: 1 1 45%; border-bottom: 1px solid var(--line-soft); }
  .part-label { font-size: 0.72rem; padding: 5px 9px 5px 7px; }
  .kb-rows a { grid-template-columns: 1fr; gap: 12px; }
  .kb-rows img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .kb-tiles { grid-template-columns: 1fr; }
  .kb-tiles a:nth-child(odd) { border-right: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .guide-list a { grid-template-columns: 76px 1fr; }
  .guide-list img { width: 76px; height: 52px; }
  .terms-list > li { padding-left: 54px; }
  .hero-actions .btn { width: 100%; }
}

@media (max-width: 380px) {
  .wrap, .wrap-narrow { width: calc(100% - 28px); }
  h1 { font-size: 1.9rem; }
  .part-label.p2, .part-label.p3 { display: none; }
  .spec-rail dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .part-label, .conveyor::after { animation: none; }
}
