:root {
  color-scheme: light;

  --a-900: #0093a8;
  --a-700: #33a9b9;
  --a-500: #66becb;
  --a-300: #99d4dc;
  --a-100: #cce9ee;

  --bg: #ffffff;
  --bg-tint: #f3f9fa;
  --surface: #ffffff;
  --surface-2: #f2f7f8;
  --line: #e0eaec;
  --line-strong: #c3d5d8;
  --ink: #0f2226;
  --ink-2: #3f5558;
  --ink-3: #5c7175;

  --accent-ink: #007385;
  --accent-soft: #eef8fa;
  --accent-line: var(--a-300);
  --on-accent: #0b1f23;
  --focus: var(--a-900);
  --glow: rgba(0, 147, 168, 0.35);

  --shadow-sm: 0 1px 2px rgba(15, 34, 38, 0.05), 0 2px 10px -4px rgba(15, 34, 38, 0.08);
  --shadow: 0 1px 2px rgba(15, 34, 38, 0.04), 0 22px 44px -24px rgba(15, 34, 38, 0.28);
  --shadow-lg: 0 2px 4px rgba(15, 34, 38, 0.04), 0 40px 80px -36px rgba(15, 34, 38, 0.4);
  --chain-shadow: rgba(15, 34, 38, 0.28);

  --stage: #ffffff;
  --dot: rgba(0, 147, 168, 0.16);

  --d-body: #edf2f3;
  --d-edge: #b6c5c8;
  --d-bevel: rgba(255, 255, 255, 0.8);
  --d-clip: #d2dddf;
  --d-clip-edge: #a5b7ba;
  --d-metal: #8a999c;
  --d-slot: #c2ced1;
  --d-hole: #7f8f93;
  --d-plate: #cfd6d9;
  --d-plate-edge: #8d9a9e;
  --gold: #c4a052;

  --link-edge: #33393d;

  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 140ms;
  --t: 200ms;
  --t-slow: 320ms;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 28px;

  --gutter: 16px;
  --section: clamp(72px, 10vw, 128px);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b1416;
  --bg-tint: #0e191c;
  --surface: #111e21;
  --surface-2: #142427;
  --line: rgba(204, 233, 238, 0.09);
  --line-strong: rgba(204, 233, 238, 0.19);
  --ink: #e3f0f2;
  --ink-2: #a8bdc1;
  --ink-3: #84999d;

  --accent-ink: var(--a-300);
  --accent-soft: rgba(102, 190, 203, 0.1);
  --accent-line: rgba(102, 190, 203, 0.45);
  --on-accent: #0b1416;
  --focus: var(--a-300);
  --glow: rgba(102, 190, 203, 0.3);

  --shadow-sm: none;
  --shadow: 0 22px 44px -24px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 80px -36px rgba(0, 0, 0, 0.8);
  --chain-shadow: rgba(0, 0, 0, 0.6);

  --stage: #101c1f;
  --dot: rgba(153, 212, 220, 0.1);

  --d-body: #1b2427;
  --d-edge: #374348;
  --d-bevel: rgba(255, 255, 255, 0.04);
  --d-clip: #2a3539;
  --d-clip-edge: #47555a;
  --d-metal: #5f6b70;
  --d-slot: #0e1416;
  --d-hole: #050809;
  --d-plate: #9aa5a9;
  --d-plate-edge: #c5cdd0;

  --link-edge: #454e53;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line-strong) var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}

::selection { background: var(--a-100); color: #0b1f23; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--a-300); }

h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

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

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -60px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top var(--t) var(--ease);
}
.skip:focus { top: 12px; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 16px;
}
.kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--a-500);
}

.label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label--accent { color: var(--accent-ink); }

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn__icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t) var(--ease); }

.btn--primary {
  background: var(--a-500);
  color: var(--on-accent);
  box-shadow: 0 10px 24px -12px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn--primary:hover { background: var(--a-700); box-shadow: 0 14px 30px -12px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn--primary:hover .btn__icon { transform: translateX(3px); }
.btn--primary:active { background: var(--a-700); }

.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--a-300); }

.btn--small { height: 34px; padding: 0 14px; font-size: 14px; border-radius: var(--r-sm); box-shadow: none; }

/* top bar */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
}

.top__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.top__right { display: flex; align-items: center; gap: 8px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.16em;
}

.logo__mark { width: 24px; height: 24px; fill: var(--a-500); flex: none; }

.nav { display: flex; gap: 2px; }

.nav a {
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 15px;
  color: var(--ink-2);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a:active { background: var(--line); }

@media (max-width: 640px) {
  .nav { display: none; }
}

.theme {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.theme:hover { color: var(--ink); background: var(--surface-2); border-color: var(--line-strong); }
.theme:active { transform: scale(0.95); }

.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme__sun { display: none; }
:root[data-theme="dark"] .theme__sun { display: block; }
:root[data-theme="dark"] .theme__moon { display: none; }

/* hero */

.hero {
  position: relative;
  padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(70% 60% at 80% 30%, color-mix(in srgb, var(--a-100) 70%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 85%);
  overflow: hidden;
}

:root[data-theme="dark"] .hero {
  background:
    radial-gradient(70% 60% at 80% 30%, rgba(102, 190, 203, 0.14) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 85%);
}

.hero__grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero__grid { grid-template-columns: 1.05fr 1fr; gap: 56px; }
}

.hero__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 17vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin-left: -0.04em;
}

@media (min-width: 960px) {
  .hero__mark { font-size: clamp(5rem, 7.6vw, 7.5rem); }
}

.hero__lede {
  margin-top: 28px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  max-width: 28ch;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }

@media (max-width: 520px) {
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .stats dd { font-size: 30px; }
}

.stats dd {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
}

.stats dt {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hero__photo { position: relative; }

.hero__photo::before {
  content: "";
  position: absolute;
  inset: 8% 6%;
  border-radius: 50%;
  background: var(--a-500);
  opacity: 0.35;
  filter: blur(60px);
  z-index: 0;
}

:root[data-theme="dark"] .hero__photo::before { opacity: 0.22; }

.photo {
  position: relative;
  z-index: 1;
  border-radius: var(--r-xl);
  background: #ffffff;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(15, 34, 38, 0.06);
  max-width: 560px;
  margin-inline: auto;
}

.photo img { width: 100%; border-radius: inherit; }

.hero__photo figcaption {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pin {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--a-500);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(15, 34, 38, 0.3);
}

.pin::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--a-500);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .pin::after { animation: ping 2.6s var(--ease) infinite; }
  .pin:nth-of-type(2)::after { animation-delay: 0.65s; }
  .pin:nth-of-type(3)::after { animation-delay: 1.3s; }
  .pin:nth-of-type(4)::after { animation-delay: 1.95s; }
}

@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.9; }
  70%, 100% { transform: scale(1.8); opacity: 0; }
}

.pin b {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dfe9eb;
  box-shadow: 0 6px 16px -8px rgba(15, 34, 38, 0.35);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #0f2226;
}
.pin--l b { right: calc(100% + 12px); }
.pin--r b { left: calc(100% + 12px); }

@media (max-width: 520px) {
  .pin b { font-size: 11px; padding: 5px 8px; }
  .pin--l b { right: calc(100% + 8px); }
  .pin--r b { left: calc(100% + 8px); }
}

/* sections */

.section {
  padding-block: var(--section);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 62px;
}

.section--tint { background: var(--bg-tint); }
.section--compact { padding-block: clamp(56px, 8vw, 96px); }

.head {
  display: grid;
  gap: 20px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

@media (min-width: 860px) {
  .head {
    grid-template-columns: 5fr 6fr;
    gap: 64px;
    align-items: end;
  }
}

.head--tight { margin-bottom: clamp(28px, 4vw, 40px); }

.head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.head__text { display: grid; gap: 16px; color: var(--ink-2); max-width: 60ch; }

/* spec */

.spec {
  display: grid;
  gap: 0 32px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) { .spec { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .spec { grid-template-columns: repeat(3, 1fr); } }

.spec div {
  padding: 18px 0 22px;
  border-top: 1px solid var(--line);
}

.spec dt {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.spec dd { font-size: 17px; line-height: 1.5; max-width: 32ch; }

.sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 4px;
  vertical-align: -2px;
  box-shadow: inset 0 0 0 1px rgba(15, 34, 38, 0.18);
}
.sw--black { background: #1f2326; }
.sw--grey { background: #cdd3d5; }

/* name */

.words {
  display: grid;
  gap: 12px;
}

@media (min-width: 760px) {
  .words { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.word {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.word__term {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.word__def {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
  color: var(--accent-ink);
}

.word__note { margin-top: 4px; font-size: 15px; color: var(--ink-2); }

/* builder: sets */

.sets { margin-bottom: 16px; }

.sets__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.sets__label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

.sets__presets { display: flex; flex-wrap: wrap; gap: 6px; }

.set {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 15px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.set:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.set:active { transform: scale(0.97); }
.set[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--a-500);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-500) 18%, transparent);
}

.set--own { font-weight: 600; color: var(--ink); }

.set__count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  background: var(--a-500);
  color: var(--on-accent);
}

.sets__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  min-height: 34px;
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 15px;
}

/* builder: stage */

.stage {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background-color: var(--stage);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 18px 18px;
  background-position: 9px 9px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stage__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.stage__name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }

@media (max-width: 520px) {
  .stage__bar { flex-direction: column; align-items: flex-start; gap: 2px; }
}

.readout {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
}

.stage__chain {
  padding: clamp(48px, 7vw, 80px) 20px;
  overflow: hidden;
}

.chain {
  display: block;
  margin-inline: auto;
  overflow: visible;
  filter: drop-shadow(0 12px 14px var(--chain-shadow));
}

/* chain links, styled after the prototype: matte black bodies, brushed-metal joint plates */

.chain__inner,
.link { transition: transform var(--t-slow) var(--ease); }

.l-body { fill: url(#g-body); stroke: var(--link-edge); stroke-width: 1; }
.l-sheen { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }
.l-cap { fill: url(#g-metal); }
.l-slot { fill: #0a0c0d; }
.l-screw { fill: #6c757a; }
.l-plate { fill: url(#g-plate); stroke: #6b7478; stroke-width: 0.6; }
.l-seam { stroke: #5d666a; stroke-width: 0.7; }
.l-shine { stroke: rgba(255, 255, 255, 0.55); stroke-width: 0.5; }

.l-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  fill: #aab4b8;
}

.is-base .l-body { stroke: var(--a-500); stroke-width: 1.5; }
.is-base .l-text { fill: var(--a-500); letter-spacing: 0.14em; }

.link.is-entering .link__in { animation: link-in var(--t-slow) var(--ease) both; }
.link.is-leaving .link__in { animation: link-out var(--t) var(--ease) both; }

@keyframes link-in {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: none; }
}
@keyframes link-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-14px); }
}

/* builder: base + modules */

.build__grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 960px) {
  .build__grid { grid-template-columns: 290px 1fr; gap: 24px; }
}

.base {
  align-self: start;
  padding: 20px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
}

.base__list { display: grid; gap: 12px; margin-top: 16px; }

.base__list li {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 12px;
  align-items: baseline;
}

.base__list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--a-500);
  transform: translateY(-1px);
}

.base__name { font-size: 16px; line-height: 1.35; }
.base__desc { display: block; font-size: 14px; color: var(--ink-3); line-height: 1.4; }

.mods { container-type: inline-size; }

.mods__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin: 4px 0 14px;
}

.mods__hint { font-size: 14px; color: var(--ink-3); }

.mods__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@container (min-width: 480px) {
  .mods__grid { grid-template-columns: repeat(2, 1fr); }
  .mod--bat { grid-column: 1 / -1; }
}

@container (min-width: 760px) {
  .mods__grid { grid-template-columns: repeat(4, 1fr); }
}

.mod {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "code state"
    "name name"
    "desc desc"
    "extra extra";
  align-content: start;
  gap: 2px 12px;
  padding: 14px 14px 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.mod:hover { border-color: var(--line-strong); }
button.mod:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
button.mod:active { transform: scale(0.985); }
.mod--bat { cursor: default; }

.mod.is-on {
  border-color: var(--a-500);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--a-500), 0 12px 28px -18px var(--glow);
}

.mods.is-locked .mod { cursor: default; box-shadow: none; }
.mods.is-locked .mod:hover { border-color: var(--line); transform: none; }
.mods.is-locked .mod.is-on { box-shadow: 0 0 0 1px var(--a-500); }
.mods.is-locked .mod.is-on:hover { border-color: var(--a-500); }
.mods.is-locked button.mod:active { transform: none; }
.mods.is-locked .mod:not(.is-on) { opacity: 0.5; }

.mod__code {
  grid-area: code;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.mod__size {
  height: 8px;
  width: calc(var(--s, 1) * 10px);
  border-radius: 2px;
  background: var(--line-strong);
  flex: none;
}
.mod.is-on .mod__size { background: var(--a-500); }

.mod__name {
  grid-area: name;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.25;
}

.mod__desc { grid-area: desc; font-size: 14px; line-height: 1.45; color: var(--ink-2); }

.mod__state {
  grid-area: state;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.mod__state svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mod__state .i-check { display: none; }

.mod:hover .mod__state { color: var(--ink); }
.mod.is-on .mod__state { background: var(--a-500); border-color: var(--a-500); color: var(--on-accent); }
.mod.is-on .i-plus { display: none; }
.mod.is-on .i-check { display: inline; }
.mod__state .i-count { display: none; }
.mod--bat.is-on .i-count { display: inline; }
.mod--bat.is-on .mod__state svg { display: none; }

/* battery steppers */

.bats {
  grid-area: extra;
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

@container (min-width: 480px) {
  .bats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

.bat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 5px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color var(--t-fast) var(--ease);
}
.bat.is-on { border-color: var(--accent-line); }

.bat__label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.bat.is-on .bat__label { color: var(--ink); font-weight: 500; }
.bat.is-on .mod__size { background: var(--a-500); }

.stepper { display: inline-flex; align-items: center; gap: 2px; }

.stepper output {
  min-width: 22px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}

.step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.step svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.step:hover { border-color: var(--a-500); background: var(--accent-soft); }
.step:active { transform: scale(0.94); }
.step--add { background: var(--a-500); border-color: var(--a-500); color: var(--on-accent); }
.step--add:hover { background: var(--a-700); border-color: var(--a-700); }
.step:disabled { opacity: 0.35; cursor: default; }
.step:disabled:hover { border-color: var(--line); background: var(--surface-2); }
.step--add:disabled:hover { background: var(--a-500); border-color: var(--a-500); }
.step:disabled:active { transform: none; }

/* joint */

.joint { display: grid; gap: 16px; }

@media (min-width: 860px) {
  .joint { grid-template-columns: 1fr 1fr; }
}

.fig {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px 14px;
}

.fig figcaption {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.diagram { display: block; width: 100%; height: auto; }

.d-body { fill: var(--d-body); stroke: var(--d-edge); stroke-width: 1; }
.d-flat { stroke: none; }
.d-bevel { fill: none; stroke: var(--d-bevel); }
.d-clip { fill: var(--d-clip); stroke: var(--d-clip-edge); stroke-width: 1; }
.d-slot { fill: var(--d-slot); }
.d-hole { fill: var(--d-hole); }
.d-plate { fill: var(--d-plate); stroke: var(--d-plate-edge); stroke-width: 0.8; }
.d-seam { stroke: var(--d-plate-edge); stroke-width: 1; }
.d-pivot { fill: var(--d-hole); }
.d-metal { fill: var(--d-metal); }
.d-gold { fill: var(--gold); }
.d-ring { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.d-lead { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.d-arrow { fill: none; stroke: var(--a-900); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .d-arrow { stroke: var(--a-300); }
.d-text { font-family: var(--font-mono); font-size: 12px; fill: var(--ink-2); letter-spacing: 0.02em; }

@media (max-width: 600px) {
  .d-text { font-size: 14px; }
}

.bend {
  transform-box: view-box;
  transform-origin: 255px 104px;
  transform: rotate(-9deg);
}

@media (prefers-reduced-motion: no-preference) {
  .bend { animation: bend 3.8s var(--ease) infinite alternate; }
}

@keyframes bend {
  from { transform: rotate(-15deg); }
  to { transform: rotate(15deg); }
}

.joint__info {
  display: grid;
  gap: 40px;
  margin-top: clamp(36px, 5vw, 56px);
}

@media (min-width: 860px) {
  .joint__info { grid-template-columns: 1fr 1fr; gap: 64px; }
}

.steps { counter-reset: step; align-self: start; }

.steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 0 16px 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 15px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-ink);
}

.steps b { color: var(--ink); font-weight: 600; }

.contacts { display: grid; gap: 16px; align-content: start; color: var(--ink-2); }

.contacts__h {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  color: var(--ink);
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.pins { border-collapse: collapse; width: 100%; font-family: var(--font-mono); font-size: 14px; }

.pins th,
.pins td {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}
.pins tr:last-child th,
.pins tr:last-child td { border-bottom: 1px solid var(--line); }

.pins th { width: 72px; color: #86681f; font-weight: 500; }
:root[data-theme="dark"] .pins th { color: var(--gold); }
.pins td { color: var(--ink-2); }

.note { font-size: 15px; color: var(--ink-3); }

/* evolution */

.evo { display: grid; gap: 16px; }

@media (min-width: 760px) {
  .evo { grid-template-columns: 1fr 1fr; }
}

.evo article {
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.evo h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.evo p { color: var(--ink-2); max-width: 46ch; }

/* footer */

.foot { padding-block: 32px 40px; }

.foot__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
}

.foot .logo { color: var(--ink-2); font-size: 13px; }
.foot .logo__mark { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
