@esmirnov.ai/sperm-lab 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,7 @@ export declare const FACTORS: readonly [{
18
18
  readonly id: "exercise";
19
19
  readonly title: "Regular exercise";
20
20
  readonly evidence: "Human association";
21
- readonly summary: "Compare a sedentary example with regular physical activity over time.";
21
+ readonly summary: "Compare weekly minutes of regular physical activity in the example.";
22
22
  readonly mechanism: "Physical activity can support metabolic health and hormone balance. Some studies report better semen measures in active men.";
23
23
  readonly timescale: "Weeks to months. This example represents a new sample after development.";
24
24
  readonly limits: "Exercise does not guarantee better semen or pregnancy. Studies differ, and this example has no prescribed exercise dose.";
@@ -36,7 +36,7 @@ export declare const FACTORS: readonly [{
36
36
  readonly id: "endurance";
37
37
  readonly title: "High-volume running";
38
38
  readonly evidence: "Mixed evidence";
39
- readonly summary: "Explore a possible pathway during heavy endurance training with poor recovery.";
39
+ readonly summary: "Set weekly hours of hard running in a scenario with poor recovery.";
40
40
  readonly mechanism: "Low energy availability, heat, and insufficient recovery can accompany heavy training. These conditions can affect reproductive hormone signals.";
41
41
  readonly timescale: "Weeks to months. This example represents a later sample.";
42
42
  readonly limits: "Running is not inherently harmful. Endurance studies report inconsistent results. The scene shows one possible pathway, without a mileage threshold.";
@@ -48,7 +48,7 @@ export declare const FACTORS: readonly [{
48
48
  readonly id: "cycling";
49
49
  readonly title: "Long cycling sessions";
50
50
  readonly evidence: "Mixed evidence";
51
- readonly summary: "Explore exercise conditions during prolonged cycling.";
51
+ readonly summary: "Set weekly hours spent in long cycling sessions.";
52
52
  readonly mechanism: "Long sessions can involve local heat and pressure. Some studies report differences in semen measures among cyclists.";
53
53
  readonly timescale: "Repeated exposure over weeks. This example represents a later sample.";
54
54
  readonly limits: "Studies do not establish a universal cycling threshold. The scene shows a possible adverse example, not an inevitable effect.";
@@ -63,7 +63,7 @@ export declare const FACTORS: readonly [{
63
63
  readonly id: "smoking";
64
64
  readonly title: "Smoking";
65
65
  readonly evidence: "Human association";
66
- readonly summary: "Inspect a possible effect of repeated tobacco smoke exposure.";
66
+ readonly summary: "Set the usual number of cigarettes smoked per day in the example.";
67
67
  readonly mechanism: "Smoke constituents can contribute to oxidative stress and DNA damage. Membrane damage can interfere with active movement.";
68
68
  readonly timescale: "Repeated exposure and sperm development. A new cohort replaces the initial sample.";
69
69
  readonly limits: "A cigarette does not instantly reshape a sperm. The scene does not predict the effect of a cigarette count.";
@@ -78,19 +78,22 @@ export declare const FACTORS: readonly [{
78
78
  readonly id: "alcohol";
79
79
  readonly title: "Heavy alcohol use";
80
80
  readonly evidence: "Human association";
81
- readonly summary: "Explore repeated heavy alcohol use during sperm development.";
81
+ readonly summary: "Set weekly U.S. standard drinks. One standard drink contains 14 grams of pure alcohol.";
82
82
  readonly mechanism: "Chronic heavy alcohol use can disrupt hormone balance and sperm production. Studies also report changes in movement and shape.";
83
83
  readonly timescale: "Repeated exposure over weeks to months. This scene uses a new sample.";
84
84
  readonly limits: "Heavy use differs from moderate consumption. No established dose-response curve converts drinks into the counts in this scene.";
85
85
  readonly sources: readonly [{
86
86
  readonly title: "ASRM: Optimizing natural fertility";
87
87
  readonly url: "https://www.asrm.org/practice-guidance/practice-committee-documents/optimizing-natural-fertility-a-committee-opinion-2021/";
88
+ }, {
89
+ readonly title: "NIAAA: What is a standard drink?";
90
+ readonly url: "https://www.niaaa.nih.gov/alcohols-effects-health/what-standard-drink";
88
91
  }];
89
92
  }, {
90
93
  readonly id: "stress";
91
94
  readonly title: "Chronic stress";
92
95
  readonly evidence: "Mixed evidence";
93
- readonly summary: "Explore one possible link between prolonged psychological stress and reproduction.";
96
+ readonly summary: "Set the number of days with prolonged stress in a typical week in the example.";
94
97
  readonly mechanism: "Stress-related hormone signals can affect reproductive pathways. Human studies report variable associations with semen measures.";
95
98
  readonly timescale: "Prolonged exposure. This example represents a later sample.";
96
99
  readonly limits: "Association does not prove cause. A stressful day does not determine sperm quality. This scene shows an uncertain pathway.";
@@ -105,7 +108,7 @@ export declare const FACTORS: readonly [{
105
108
  readonly id: "sleep";
106
109
  readonly title: "Disrupted sleep";
107
110
  readonly evidence: "Human association";
108
- readonly summary: "Explore research on disturbed sleep and semen quality.";
111
+ readonly summary: "Set the number of nights with disrupted sleep in a typical week in the example.";
109
112
  readonly mechanism: "Sleep patterns relate to daily hormone rhythms. Observational studies report associations between disturbed sleep and some semen measures.";
110
113
  readonly timescale: "Habitual sleep patterns. This example represents a later sample.";
111
114
  readonly limits: "These associations do not prove cause. The model does not prescribe sleep hours or predict damage after a poor night.";
@@ -120,10 +123,10 @@ export declare const FACTORS: readonly [{
120
123
  readonly id: "heat";
121
124
  readonly title: "Prolonged heat";
122
125
  readonly evidence: "Established mechanism";
123
- readonly summary: "Explore sustained heat exposure during sperm development.";
126
+ readonly summary: "Set weekly hours of extra heat exposure in a repeated exposure scenario.";
124
127
  readonly mechanism: "Increased testicular temperature can disturb sperm production and function. This example changes the later cohort, not the current fluid temperature.";
125
128
  readonly timescale: "Sustained exposure, followed by delayed sample changes.";
126
- readonly limits: "The slider is not a temperature scale. Exposure duration and individual responses differ. Normal warmth does not imply damage.";
129
+ readonly limits: "The model does not measure temperature. Heat sources and individual responses differ. Normal warmth does not imply damage.";
127
130
  readonly sources: readonly [{
128
131
  title: string;
129
132
  url: string;
@@ -135,7 +138,7 @@ export declare const FACTORS: readonly [{
135
138
  readonly id: "fever";
136
139
  readonly title: "Fever";
137
140
  readonly evidence: "Human association";
138
- readonly summary: "Explore a temporary disturbance after a febrile illness.";
141
+ readonly summary: "Set how many days a single fever episode lasts in the example.";
139
142
  readonly mechanism: "Fever can disrupt developing sperm. Changes in concentration, movement, and shape can appear after the illness.";
140
143
  readonly timescale: "Delayed effects over subsequent weeks. Recovery also takes time.";
141
144
  readonly limits: "Responses differ with the illness and its timing. This example does not set a recovery date or diagnose an infection.";
@@ -147,7 +150,7 @@ export declare const FACTORS: readonly [{
147
150
  readonly id: "metabolic";
148
151
  readonly title: "Obesity and metabolic health";
149
152
  readonly evidence: "Human association";
150
- readonly summary: "Explore one pathway that links metabolic conditions with sperm development.";
153
+ readonly summary: "Choose a modeled level of metabolic stress during sperm development.";
151
154
  readonly mechanism: "Hormone balance, inflammation, and heat can differ with metabolic conditions. Population studies associate obesity with poorer semen measures.";
152
155
  readonly timescale: "Longer-term conditions. This example represents a later sample.";
153
156
  readonly limits: "Body size does not diagnose fertility. Individuals differ, and the scene does not assign a target weight or a fertility score.";
@@ -162,7 +165,7 @@ export declare const FACTORS: readonly [{
162
165
  readonly id: "androgens";
163
166
  readonly title: "Testosterone and anabolic steroids";
164
167
  readonly evidence: "Established mechanism";
165
- readonly summary: "See why external testosterone can suppress sperm production.";
168
+ readonly summary: "Choose a modeled level of exposure to external androgens.";
166
169
  readonly mechanism: "External androgens suppress pituitary signals that support sperm production. A higher blood testosterone level does not guarantee more sperm.";
167
170
  readonly timescale: "Suppression and recovery develop over months. Individual timing differs.";
168
171
  readonly limits: "This scene does not give medication advice or a recovery schedule. Steroid-associated suppression differs from ordinary exercise.";
@@ -177,7 +180,7 @@ export declare const FACTORS: readonly [{
177
180
  readonly id: "pesticides";
178
181
  readonly title: "Certain pesticides";
179
182
  readonly evidence: "Human association";
180
- readonly summary: "Explore an example of repeated exposure to a specific class of chemicals.";
183
+ readonly summary: "Choose a modeled level of repeated exposure to one example class of chemicals.";
181
184
  readonly mechanism: "Some chemicals can disturb hormone signals or contribute to cellular stress. Effects depend on the substance and exposure.";
182
185
  readonly timescale: "Substance-specific exposure and sperm development. This example uses a later sample.";
183
186
  readonly limits: "Pesticides are not one substance. This scene is not an exposure calculator and does not represent all products.";
@@ -12,7 +12,7 @@ export const ANATOMY_SOURCES = [
12
12
  export const FACTORS = [
13
13
  {
14
14
  id: "exercise", title: "Regular exercise", evidence: "Human association",
15
- summary: "Compare a sedentary example with regular physical activity over time.",
15
+ summary: "Compare weekly minutes of regular physical activity in the example.",
16
16
  mechanism: "Physical activity can support metabolic health and hormone balance. Some studies report better semen measures in active men.",
17
17
  timescale: "Weeks to months. This example represents a new sample after development.",
18
18
  limits: "Exercise does not guarantee better semen or pregnancy. Studies differ, and this example has no prescribed exercise dose.",
@@ -20,7 +20,7 @@ export const FACTORS = [
20
20
  },
21
21
  {
22
22
  id: "endurance", title: "High-volume running", evidence: "Mixed evidence",
23
- summary: "Explore a possible pathway during heavy endurance training with poor recovery.",
23
+ summary: "Set weekly hours of hard running in a scenario with poor recovery.",
24
24
  mechanism: "Low energy availability, heat, and insufficient recovery can accompany heavy training. These conditions can affect reproductive hormone signals.",
25
25
  timescale: "Weeks to months. This example represents a later sample.",
26
26
  limits: "Running is not inherently harmful. Endurance studies report inconsistent results. The scene shows one possible pathway, without a mileage threshold.",
@@ -28,7 +28,7 @@ export const FACTORS = [
28
28
  },
29
29
  {
30
30
  id: "cycling", title: "Long cycling sessions", evidence: "Mixed evidence",
31
- summary: "Explore exercise conditions during prolonged cycling.",
31
+ summary: "Set weekly hours spent in long cycling sessions.",
32
32
  mechanism: "Long sessions can involve local heat and pressure. Some studies report differences in semen measures among cyclists.",
33
33
  timescale: "Repeated exposure over weeks. This example represents a later sample.",
34
34
  limits: "Studies do not establish a universal cycling threshold. The scene shows a possible adverse example, not an inevitable effect.",
@@ -36,7 +36,7 @@ export const FACTORS = [
36
36
  },
37
37
  {
38
38
  id: "smoking", title: "Smoking", evidence: "Human association",
39
- summary: "Inspect a possible effect of repeated tobacco smoke exposure.",
39
+ summary: "Set the usual number of cigarettes smoked per day in the example.",
40
40
  mechanism: "Smoke constituents can contribute to oxidative stress and DNA damage. Membrane damage can interfere with active movement.",
41
41
  timescale: "Repeated exposure and sperm development. A new cohort replaces the initial sample.",
42
42
  limits: "A cigarette does not instantly reshape a sperm. The scene does not predict the effect of a cigarette count.",
@@ -44,15 +44,15 @@ export const FACTORS = [
44
44
  },
45
45
  {
46
46
  id: "alcohol", title: "Heavy alcohol use", evidence: "Human association",
47
- summary: "Explore repeated heavy alcohol use during sperm development.",
47
+ summary: "Set weekly U.S. standard drinks. One standard drink contains 14 grams of pure alcohol.",
48
48
  mechanism: "Chronic heavy alcohol use can disrupt hormone balance and sperm production. Studies also report changes in movement and shape.",
49
49
  timescale: "Repeated exposure over weeks to months. This scene uses a new sample.",
50
50
  limits: "Heavy use differs from moderate consumption. No established dose-response curve converts drinks into the counts in this scene.",
51
- sources: [{ title: "ASRM: Optimizing natural fertility", url: "https://www.asrm.org/practice-guidance/practice-committee-documents/optimizing-natural-fertility-a-committee-opinion-2021/" }],
51
+ sources: [{ title: "ASRM: Optimizing natural fertility", url: "https://www.asrm.org/practice-guidance/practice-committee-documents/optimizing-natural-fertility-a-committee-opinion-2021/" }, { title: "NIAAA: What is a standard drink?", url: "https://www.niaaa.nih.gov/alcohols-effects-health/what-standard-drink" }],
52
52
  },
53
53
  {
54
54
  id: "stress", title: "Chronic stress", evidence: "Mixed evidence",
55
- summary: "Explore one possible link between prolonged psychological stress and reproduction.",
55
+ summary: "Set the number of days with prolonged stress in a typical week in the example.",
56
56
  mechanism: "Stress-related hormone signals can affect reproductive pathways. Human studies report variable associations with semen measures.",
57
57
  timescale: "Prolonged exposure. This example represents a later sample.",
58
58
  limits: "Association does not prove cause. A stressful day does not determine sperm quality. This scene shows an uncertain pathway.",
@@ -60,7 +60,7 @@ export const FACTORS = [
60
60
  },
61
61
  {
62
62
  id: "sleep", title: "Disrupted sleep", evidence: "Human association",
63
- summary: "Explore research on disturbed sleep and semen quality.",
63
+ summary: "Set the number of nights with disrupted sleep in a typical week in the example.",
64
64
  mechanism: "Sleep patterns relate to daily hormone rhythms. Observational studies report associations between disturbed sleep and some semen measures.",
65
65
  timescale: "Habitual sleep patterns. This example represents a later sample.",
66
66
  limits: "These associations do not prove cause. The model does not prescribe sleep hours or predict damage after a poor night.",
@@ -68,15 +68,15 @@ export const FACTORS = [
68
68
  },
69
69
  {
70
70
  id: "heat", title: "Prolonged heat", evidence: "Established mechanism",
71
- summary: "Explore sustained heat exposure during sperm development.",
71
+ summary: "Set weekly hours of extra heat exposure in a repeated exposure scenario.",
72
72
  mechanism: "Increased testicular temperature can disturb sperm production and function. This example changes the later cohort, not the current fluid temperature.",
73
73
  timescale: "Sustained exposure, followed by delayed sample changes.",
74
- limits: "The slider is not a temperature scale. Exposure duration and individual responses differ. Normal warmth does not imply damage.",
74
+ limits: "The model does not measure temperature. Heat sources and individual responses differ. Normal warmth does not imply damage.",
75
75
  sources: [eau, { title: "Scrotal heat stress and sperm chromatin damage in fertile men", url: "https://pmc.ncbi.nlm.nih.gov/articles/PMC4429437/" }],
76
76
  },
77
77
  {
78
78
  id: "fever", title: "Fever", evidence: "Human association",
79
- summary: "Explore a temporary disturbance after a febrile illness.",
79
+ summary: "Set how many days a single fever episode lasts in the example.",
80
80
  mechanism: "Fever can disrupt developing sperm. Changes in concentration, movement, and shape can appear after the illness.",
81
81
  timescale: "Delayed effects over subsequent weeks. Recovery also takes time.",
82
82
  limits: "Responses differ with the illness and its timing. This example does not set a recovery date or diagnose an infection.",
@@ -84,7 +84,7 @@ export const FACTORS = [
84
84
  },
85
85
  {
86
86
  id: "metabolic", title: "Obesity and metabolic health", evidence: "Human association",
87
- summary: "Explore one pathway that links metabolic conditions with sperm development.",
87
+ summary: "Choose a modeled level of metabolic stress during sperm development.",
88
88
  mechanism: "Hormone balance, inflammation, and heat can differ with metabolic conditions. Population studies associate obesity with poorer semen measures.",
89
89
  timescale: "Longer-term conditions. This example represents a later sample.",
90
90
  limits: "Body size does not diagnose fertility. Individuals differ, and the scene does not assign a target weight or a fertility score.",
@@ -92,7 +92,7 @@ export const FACTORS = [
92
92
  },
93
93
  {
94
94
  id: "androgens", title: "Testosterone and anabolic steroids", evidence: "Established mechanism",
95
- summary: "See why external testosterone can suppress sperm production.",
95
+ summary: "Choose a modeled level of exposure to external androgens.",
96
96
  mechanism: "External androgens suppress pituitary signals that support sperm production. A higher blood testosterone level does not guarantee more sperm.",
97
97
  timescale: "Suppression and recovery develop over months. Individual timing differs.",
98
98
  limits: "This scene does not give medication advice or a recovery schedule. Steroid-associated suppression differs from ordinary exercise.",
@@ -100,7 +100,7 @@ export const FACTORS = [
100
100
  },
101
101
  {
102
102
  id: "pesticides", title: "Certain pesticides", evidence: "Human association",
103
- summary: "Explore an example of repeated exposure to a specific class of chemicals.",
103
+ summary: "Choose a modeled level of repeated exposure to one example class of chemicals.",
104
104
  mechanism: "Some chemicals can disturb hormone signals or contribute to cellular stress. Effects depend on the substance and exposure.",
105
105
  timescale: "Substance-specific exposure and sperm development. This example uses a later sample.",
106
106
  limits: "Pesticides are not one substance. This scene is not an exposure calculator and does not represent all products.",
@@ -41,7 +41,7 @@ function paintCell(context, cell, time, width, height, palette, display) {
41
41
  const selected = cell.id === display.selected;
42
42
  const color = selected ? palette.accent : palette.ink;
43
43
  const damage = palette.damage ?? "#b82735";
44
- const paper = palette.paper ?? "#eff2ed";
44
+ const paper = palette.paper ?? "#fbfdff";
45
45
  const geometry = getCellGeometry(cell, time, width, height);
46
46
  const { anchor, scale, headRx: rx, headRy: ry } = geometry;
47
47
  const opacity = cell.alive ? .97 : .66;
@@ -10,10 +10,42 @@ const groups = [
10
10
  { title: "Chemicals", ids: ["androgens", "pesticides"], side: "right" },
11
11
  ];
12
12
  const shortLabels = {
13
- exercise: "Regular exercise", endurance: "Heavy running", cycling: "Long cycling", smoking: "Smoking", alcohol: "Heavy alcohol",
13
+ exercise: "Regular exercise", endurance: "Heavy running", cycling: "Long cycling", smoking: "Smoking", alcohol: "Alcohol use",
14
14
  stress: "Chronic stress", sleep: "Poor sleep", heat: "Prolonged heat", fever: "Fever", metabolic: "Metabolic stress",
15
15
  androgens: "External androgens", pesticides: "Certain pesticides",
16
16
  };
17
+ const scenarioLevels = ["Off", "Low", "Moderate", "High"];
18
+ const factorControls = {
19
+ exercise: { max: 300, step: 15, unit: ["min/week", "min/week"] },
20
+ endurance: { max: 15, step: 1, unit: ["hour/week", "hours/week"] },
21
+ cycling: { max: 20, step: 1, unit: ["hour/week", "hours/week"] },
22
+ smoking: { max: 40, step: 1, unit: ["cigarette/day", "cigarettes/day"] },
23
+ alcohol: { max: 35, step: 1, unit: ["drink/week", "drinks/week"] },
24
+ stress: { max: 7, step: 1, unit: ["day/week", "days/week"] },
25
+ sleep: { max: 7, step: 1, unit: ["night/week", "nights/week"] },
26
+ heat: { max: 14, step: 1, unit: ["hour/week", "hours/week"] },
27
+ fever: { max: 7, step: 1, unit: ["day", "days"] },
28
+ metabolic: scenarioLevels,
29
+ androgens: scenarioLevels,
30
+ pesticides: scenarioLevels,
31
+ };
32
+ function factorSlider(id, strength) {
33
+ const control = factorControls[id];
34
+ if ("max" in control) {
35
+ const { max, step, unit } = control;
36
+ const value = Math.round(strength * max / step) * step;
37
+ if (strength > 0 && value === 0) {
38
+ const firstStep = `${step} ${unit[step === 1 ? 0 : 1]}`;
39
+ return { max, step, value, text: `<${firstStep}`, spokenText: `Less than ${firstStep}` };
40
+ }
41
+ const text = `${value} ${unit[value === 1 ? 0 : 1]}`;
42
+ return { max, step, value, text, spokenText: text };
43
+ }
44
+ const max = control.length - 1;
45
+ const value = strength > 0 ? Math.max(1, Math.round(strength * max)) : 0;
46
+ const text = control[value];
47
+ return { max, step: 1, value, text, spokenText: `${text} (illustrative scenario)` };
48
+ }
17
49
  function finite(value, fallback, min, max) {
18
50
  return Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : fallback;
19
51
  }
@@ -101,7 +133,7 @@ export function SpermLab({ seed = 42, count = 48, initialFactors, initialFactor,
101
133
  setPaused(true);
102
134
  }
103
135
  let frame = 0, idleFrame = 0, last = 0, visible = true, destroyed = false, width = 0, height = 0;
104
- let palette = { ink: "#303832", sage: "#6f897c", clay: "#a67769", accent: "#785448", paper: "#eff2ed", damage: "#b82735" };
136
+ let palette = { ink: "#17243a", sage: "#337e90", clay: "#a15570", accent: "#1557df", paper: "#fbfdff", damage: "#b82735" };
105
137
  function draw() {
106
138
  if (!world.current)
107
139
  return;
@@ -197,7 +229,7 @@ export function SpermLab({ seed = 42, count = 48, initialFactors, initialFactor,
197
229
  return;
198
230
  const computed = getComputedStyle(root.current);
199
231
  const token = (name, fallback) => computed.getPropertyValue(name).trim() || fallback;
200
- palette = { ink: computed.color, sage: token("--sl-sage", "#6f897c"), clay: token("--sl-clay", "#a67769"), accent: token("--sl-accent", "#785448"), paper: token("--sl-paper", "#eff2ed"), damage: token("--sl-damage", "#b82735") };
232
+ palette = { ink: computed.color, sage: token("--sl-sage", "#337e90"), clay: token("--sl-clay", "#a15570"), accent: token("--sl-accent", "#1557df"), paper: token("--sl-paper", "#fbfdff"), damage: token("--sl-damage", "#b82735") };
201
233
  width = surface.clientWidth;
202
234
  height = surface.clientHeight;
203
235
  if (!width || !height)
@@ -413,12 +445,13 @@ export function SpermLab({ seed = 42, count = 48, initialFactors, initialFactor,
413
445
  }
414
446
  function controlColumn(side) {
415
447
  return _jsx("aside", { className: `sl-controls sl-controls-${side}`, "aria-label": `${side === "left" ? "Exercise and habits" : "Body and chemicals"} factors`, children: groups.filter(group => group.side === side).map(group => _jsxs("fieldset", { className: "sl-factor-group", children: [_jsx("legend", { children: group.title }), group.ids.map(id => {
416
- const factor = FACTORS.find(item => item.id === id), value = Math.round((factors[id] ?? 0) * 100);
448
+ const factor = FACTORS.find(item => item.id === id);
449
+ const { max, step, value, text, spokenText } = factorSlider(id, factors[id] ?? 0);
417
450
  const rangeId = `${prefix}-${id}`;
418
- return _jsxs("div", { className: "sl-factor", children: [_jsxs("div", { className: "sl-factor-row", children: [_jsx("label", { htmlFor: rangeId, children: shortLabels[id] }), _jsx("input", { id: rangeId, "data-factor": id, type: "range", min: "0", max: "100", step: "1", value: value, "aria-label": shortLabels[id] === factor.title ? factor.title : `${shortLabels[id]}: ${factor.title}`, "aria-valuetext": `${value} of 100, relative illustrative setting`, style: { "--sl-progress": `${value}%` }, onChange: event => changeFactor(id, Number(event.target.value) / 100) }), _jsx("output", { htmlFor: rangeId, children: value })] }), _jsxs("details", { className: "sl-factor-help", children: [_jsxs("summary", { children: [_jsxs("span", { children: ["About ", shortLabels[id].toLowerCase()] }), _jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", children: _jsx("path", { d: "m5 6 3 3 3-3" }) })] }), _jsx("p", { children: factor.summary }), _jsx("p", { children: factor.mechanism }), _jsx("p", { className: "sl-evidence", children: factor.evidence }), _jsx("p", { children: factor.limits }), _jsx("p", { className: "sl-help-timescale", children: factor.timescale }), _jsx("ul", { children: factor.sources.map(source => _jsx("li", { children: _jsx("a", { href: source.url, target: "_blank", rel: "noopener noreferrer", children: source.title }) }, source.url)) })] })] }, id);
451
+ return _jsxs("div", { className: "sl-factor", children: [_jsxs("div", { className: "sl-factor-row", children: [_jsx("label", { htmlFor: rangeId, children: shortLabels[id] }), _jsx("input", { id: rangeId, "data-factor": id, type: "range", min: 0, max: max, step: step, value: value, "aria-label": shortLabels[id] === factor.title ? factor.title : `${shortLabels[id]}: ${factor.title}`, "aria-valuetext": spokenText, style: { "--sl-progress": `${value / max * 100}%` }, onChange: event => changeFactor(id, Number(event.target.value) / max) }), _jsx("output", { htmlFor: rangeId, children: text })] }), _jsxs("details", { className: "sl-factor-help", children: [_jsxs("summary", { children: [_jsxs("span", { children: ["About ", shortLabels[id].toLowerCase()] }), _jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", children: _jsx("path", { d: "m5 6 3 3 3-3" }) })] }), _jsx("p", { children: factor.summary }), _jsx("p", { children: factor.mechanism }), _jsx("p", { className: "sl-evidence", children: factor.evidence }), _jsx("p", { children: factor.limits }), _jsx("p", { className: "sl-help-timescale", children: factor.timescale }), _jsx("ul", { children: factor.sources.map(source => _jsx("li", { children: _jsx("a", { href: source.url, target: "_blank", rel: "noopener noreferrer", children: source.title }) }, source.url)) })] })] }, id);
419
452
  })] }, group.title)) });
420
453
  }
421
- return _jsxs("div", { ref: root, className: `sperm-lab sl-lab sl-lab-v3 ${className}`.trim(), style: style, children: [_jsxs("div", { className: "sl-intro-line", children: [_jsxs("p", { children: [_jsx("strong", { children: "Change the factors. Watch one sample." }), " Each slider acts independently."] }), _jsx("span", { children: "All 12 settings use relative scales." })] }), _jsxs("div", { className: "sl-workbench", children: [_jsxs("section", { className: "sl-field", "aria-label": "Live sperm sample", children: [_jsxs("div", { className: "sl-sample-bar", children: [_jsxs("div", { children: [_jsx("h2", { children: prepared ? "Prepared defect examples" : defaults.teachingPopulation ? "Illustrative sample" : "Live sample" }), _jsxs("span", { children: [metrics.total, " fictional cells"] })] }), _jsxs("div", { className: "sl-actions", children: [_jsx("button", { className: "sl-explore", type: "button", "aria-pressed": popupOpen, "aria-controls": `${prefix}-sample`, onClick: explore, children: "Explore" }), _jsx("button", { type: "button", "aria-pressed": paused, onClick: () => setPaused(value => !value), children: paused ? "Resume" : "Pause" }), _jsx("button", { type: "button", onClick: reset, children: "Reset sample" })] })] }), _jsxs("div", { className: "sl-concentration", children: [_jsx("span", { id: `${prefix}-concentration`, children: "Concentration" }), _jsxs("output", { "data-concentration": metrics.total, "aria-labelledby": `${prefix}-concentration`, children: [metrics.total, " cells / model field"] }), _jsx("small", { children: "Synthetic model count. No clinical units." })] }), unavailable && _jsx("p", { role: "status", children: "Canvas is unavailable. The sample counts, cell inspector, and factor explanations remain available." }), _jsxs("div", { id: `${prefix}-sample`, className: "sl-canvas-wrap", "data-popup": popupOpen && Boolean(selected), style: { "--sl-popup-min-height": `${popupHeight}px` }, children: [_jsx("canvas", { ref: canvas, tabIndex: 0, role: "group", "aria-label": "Interactive sperm sample. Use Explore to follow a swimmer. Drag to stir. Click a cell for details. Arrow keys create currents. Enter selects the next cell and opens its details. Escape closes details. Space pauses.", "aria-describedby": `${prefix}-help`, onPointerDown: pointerDown, onPointerMove: pointerMove, onPointerUp: pointerUp, onPointerCancel: () => actions.current.release(), onLostPointerCapture: () => { pointer.current = null; }, onKeyDown: keyboard, onContextMenu: event => event.preventDefault(), children: "The sample needs canvas support. Use the cell inspector and model counts for a text alternative." }), popupOpen && selected && _jsxs(_Fragment, { children: [_jsx("svg", { className: "sl-popup-connector", "aria-hidden": "true", children: _jsx("line", { ref: popupConnector }) }), _jsxs("div", { ref: popup, className: "sl-cell-popup", role: "dialog", "aria-modal": "false", "aria-labelledby": `${prefix}-popup-title`, "data-cell-popup": "true", "data-cell-id": selected.id, children: [_jsxs("header", { children: [_jsxs("h3", { id: `${prefix}-popup-title`, children: ["Cell ", selected.id + 1] }), _jsx("button", { ref: popupClose, className: "sl-popup-close", type: "button", "aria-label": "Close cell details", onClick: () => { setPopupOpen(false); canvas.current?.focus({ preventScroll: true }); }, children: _jsx("svg", { viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "m5 5 10 10M15 5 5 15" }) }) })] }), _jsx(CellPopupDetails, { cell: selected, dna: dna }), _jsx("button", { className: "sl-popup-anatomy", type: "button", onClick: () => { setPopupOpen(false); requestAnimationFrame(() => inspector.current?.scrollIntoView({ block: "start", behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth" })); }, children: "Full anatomy" })] })] })] }), _jsxs("div", { className: "sl-sample-tools", children: [_jsx("button", { type: "button", onClick: () => current(.3, .1), disabled: paused, children: "Create a current" }), _jsx("button", { type: "button", onClick: () => nextCell(), children: "Next swimmer" }), _jsx("button", { type: "button", onClick: prepareExamples, children: "Inspect defect examples" }), prepared && _jsx("button", { type: "button", onClick: restore, children: "Return to current settings" })] }), _jsxs("div", { className: "sl-display", children: [_jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: dna, onChange: event => setDna(event.target.checked) }), "DNA overlay"] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: trails, onChange: event => setTrails(event.target.checked) }), "Trails"] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: slowMotion, onChange: event => setSlowMotion(event.target.checked) }), "Slow motion"] })] })] }), controlColumn("left"), controlColumn("right"), _jsxs("div", { className: "sl-sample-notes", children: [_jsx("p", { id: `${prefix}-help`, className: "sl-canvas-help", children: "Use Explore to follow a swimmer. Click or tap another cell to switch. Drag to stir the sample." }), defaults.teachingPopulation && !prepared && _jsx("p", { className: "sl-teaching-population", children: "The teaching sample includes common defect examples. Counts do not show their frequency in people." }), _jsx("p", { className: "sl-overlay-note", children: "Red marks illustrated abnormalities. Disconnected red pieces inside the nucleus show schematic DNA fragmentation. The overlay is not ordinary microscopy." }), _jsx("p", { className: "sl-model-note", children: "Sliders prepare an illustrative later cohort. Counts do not predict personal fertility." }), prepared && _jsx("div", { className: "sl-prepared-note", children: _jsx("p", { children: "These examples contain head, tail, midpiece, and DNA traits. They do not show the effects of a specific exposure." }) })] }), _jsxs("section", { className: "sl-readouts", "aria-labelledby": `${prefix}-counts-title`, children: [_jsx("h2", { id: `${prefix}-counts-title`, children: "In this sample" }), _jsx("dl", { children: [
454
+ return _jsxs("div", { ref: root, className: `sperm-lab sl-lab sl-lab-v3 ${className}`.trim(), style: style, children: [_jsxs("div", { className: "sl-intro-line", children: [_jsxs("p", { children: [_jsx("strong", { children: "Change the factors. Watch one sample." }), " Each slider acts independently."] }), _jsx("span", { children: "The settings describe example habits and exposures. The sample shows illustrative responses." })] }), _jsxs("div", { className: "sl-workbench", children: [_jsxs("section", { className: "sl-field", "aria-label": "Live sperm sample", children: [_jsxs("div", { className: "sl-sample-bar", children: [_jsxs("div", { children: [_jsx("h2", { children: prepared ? "Prepared defect examples" : defaults.teachingPopulation ? "Illustrative sample" : "Live sample" }), _jsxs("span", { children: [metrics.total, " fictional cells"] })] }), _jsxs("div", { className: "sl-actions", children: [_jsx("button", { className: "sl-explore", type: "button", "aria-pressed": popupOpen, "aria-controls": `${prefix}-sample`, onClick: explore, children: "Explore" }), _jsx("button", { type: "button", "aria-pressed": paused, onClick: () => setPaused(value => !value), children: paused ? "Resume" : "Pause" }), _jsx("button", { type: "button", onClick: reset, children: "Reset sample" })] })] }), _jsxs("div", { className: "sl-concentration", children: [_jsx("span", { id: `${prefix}-concentration`, children: "Concentration" }), _jsxs("output", { "data-concentration": metrics.total, "aria-labelledby": `${prefix}-concentration`, children: [metrics.total, " cells / model field"] }), _jsx("small", { children: "Synthetic model count. No clinical units." })] }), unavailable && _jsx("p", { role: "status", children: "Canvas is unavailable. The sample counts, cell inspector, and factor explanations remain available." }), _jsxs("div", { id: `${prefix}-sample`, className: "sl-canvas-wrap", "data-popup": popupOpen && Boolean(selected), style: { "--sl-popup-min-height": `${popupHeight}px` }, children: [_jsx("canvas", { ref: canvas, tabIndex: 0, role: "group", "aria-label": "Interactive sperm sample. Use Explore to follow a swimmer. Drag to stir. Click a cell for details. Arrow keys create currents. Enter selects the next cell and opens its details. Escape closes details. Space pauses.", "aria-describedby": `${prefix}-help`, onPointerDown: pointerDown, onPointerMove: pointerMove, onPointerUp: pointerUp, onPointerCancel: () => actions.current.release(), onLostPointerCapture: () => { pointer.current = null; }, onKeyDown: keyboard, onContextMenu: event => event.preventDefault(), children: "The sample needs canvas support. Use the cell inspector and model counts for a text alternative." }), popupOpen && selected && _jsxs(_Fragment, { children: [_jsx("svg", { className: "sl-popup-connector", "aria-hidden": "true", children: _jsx("line", { ref: popupConnector }) }), _jsxs("div", { ref: popup, className: "sl-cell-popup", role: "dialog", "aria-modal": "false", "aria-labelledby": `${prefix}-popup-title`, "data-cell-popup": "true", "data-cell-id": selected.id, children: [_jsxs("header", { children: [_jsxs("h3", { id: `${prefix}-popup-title`, children: ["Cell ", selected.id + 1] }), _jsx("button", { ref: popupClose, className: "sl-popup-close", type: "button", "aria-label": "Close cell details", onClick: () => { setPopupOpen(false); canvas.current?.focus({ preventScroll: true }); }, children: _jsx("svg", { viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "m5 5 10 10M15 5 5 15" }) }) })] }), _jsx(CellPopupDetails, { cell: selected, dna: dna }), _jsx("button", { className: "sl-popup-anatomy", type: "button", onClick: () => { setPopupOpen(false); requestAnimationFrame(() => inspector.current?.scrollIntoView({ block: "start", behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth" })); }, children: "Full anatomy" })] })] })] }), _jsxs("div", { className: "sl-sample-tools", children: [_jsx("button", { type: "button", onClick: () => current(.3, .1), disabled: paused, children: "Create a current" }), _jsx("button", { type: "button", onClick: () => nextCell(), children: "Next swimmer" }), _jsx("button", { type: "button", onClick: prepareExamples, children: "Inspect defect examples" }), prepared && _jsx("button", { type: "button", onClick: restore, children: "Return to current settings" })] }), _jsxs("div", { className: "sl-display", children: [_jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: dna, onChange: event => setDna(event.target.checked) }), "DNA overlay"] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: trails, onChange: event => setTrails(event.target.checked) }), "Trails"] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: slowMotion, onChange: event => setSlowMotion(event.target.checked) }), "Slow motion"] })] })] }), controlColumn("left"), controlColumn("right"), _jsxs("div", { className: "sl-sample-notes", children: [_jsx("p", { id: `${prefix}-help`, className: "sl-canvas-help", children: "Use Explore to follow a swimmer. Click or tap another cell to switch. Drag to stir the sample." }), defaults.teachingPopulation && !prepared && _jsx("p", { className: "sl-teaching-population", children: "The teaching sample includes common defect examples. Counts do not show their frequency in people." }), _jsx("p", { className: "sl-overlay-note", children: "Red marks illustrated abnormalities. Disconnected red pieces inside the nucleus show schematic DNA fragmentation. The overlay is not ordinary microscopy." }), _jsx("p", { className: "sl-model-note", children: "Sliders prepare an illustrative later cohort. Counts do not predict personal fertility." }), prepared && _jsx("div", { className: "sl-prepared-note", children: _jsx("p", { children: "These examples contain head, tail, midpiece, and DNA traits. They do not show the effects of a specific exposure." }) })] }), _jsxs("section", { className: "sl-readouts", "aria-labelledby": `${prefix}-counts-title`, children: [_jsx("h2", { id: `${prefix}-counts-title`, children: "In this sample" }), _jsx("dl", { children: [
422
455
  ["Cells", metrics.total], ["Active motion", metrics.motile], ["Forward", metrics.progressive], ["Slow", metrics.slow],
423
456
  ["Nonprogressive", metrics.nonprogressive], ["Still", metrics.immotile], ["Alive", metrics.alive],
424
457
  ].map(([label, value]) => _jsxs("div", { children: [_jsx("dt", { children: label }), _jsx("dd", { children: value })] }, label)) })] }), _jsxs("section", { className: "sl-catalog", "aria-labelledby": `${prefix}-catalog-title`, children: [_jsxs("header", { children: [_jsx("h2", { id: `${prefix}-catalog-title`, children: "Common examples" }), _jsx("p", { children: "These curated examples explain separate traits. Their frequency is not clinical prevalence. Select an example to inspect its cell." })] }), _jsx("div", { className: "sl-defect-catalog", children: DEFECT_CATALOG.map(defect => {
package/dist/styles.css CHANGED
@@ -1,46 +1,46 @@
1
1
  .sl-lab {
2
- --sl-surface: #dfe5dc;
3
- --sl-ink: #303832;
4
- --sl-accent: #785448;
5
- --sl-paper: #eff2ed;
2
+ --sl-surface: #edf3fb;
3
+ --sl-ink: #17243a;
4
+ --sl-accent: #1557df;
5
+ --sl-paper: #fbfdff;
6
6
  --sl-rule: color-mix(in oklch, var(--sl-ink) 22%, transparent);
7
- --sl-track: color-mix(in oklch, var(--sl-ink) 28%, var(--sl-surface));
8
- --sl-sage: #6f897c;
9
- --sl-clay: #a67769;
7
+ --sl-track: color-mix(in srgb, var(--sl-ink) 17%, var(--sl-surface));
8
+ --sl-sage: #337e90;
9
+ --sl-clay: #a15570;
10
10
  --sl-damage: #b82735;
11
11
  container: sperm-lab / inline-size;
12
12
  width: 100%; min-width: 0; color: var(--sl-ink);
13
- font: 14px/1.55 Arial, Helvetica, sans-serif; color-scheme: light;
13
+ font: 14px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; color-scheme: light;
14
14
  }
15
15
  .sl-lab, .sl-lab * { box-sizing: border-box; }
16
16
  .sl-lab :is(button, input, select) { color: inherit; font: inherit; }
17
17
  .sl-lab :is(button, input, canvas, a, summary):focus-visible { outline: 2px solid var(--sl-accent); outline-offset: 3px; }
18
- .sl-lab button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--sl-rule); border-radius: 4px; background: transparent; cursor: pointer; font-size: 12px; }
19
- .sl-lab button:hover { background: color-mix(in oklch, var(--sl-ink) 6%, transparent); }
18
+ .sl-lab button { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 999px; background: var(--sl-paper); cursor: pointer; font-size: 12px; }
19
+ .sl-lab button:hover { color: var(--sl-accent); background: color-mix(in srgb, var(--sl-accent) 7%, var(--sl-paper)); }
20
20
  .sl-lab button:disabled { opacity: .4; cursor: default; }
21
21
  .sl-lab p { max-width: 72ch; }
22
22
  .sl-lab h2, .sl-lab h3 { color: inherit; letter-spacing: normal; }
23
- .sl-intro-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--sl-rule); }
23
+ .sl-intro-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; margin-bottom: 22px; }
24
24
  .sl-intro-line p { margin: 0; font-size: 13px; }
25
25
  .sl-intro-line strong { font-weight: 600; }
26
26
  .sl-intro-line > span { font-size: 11px; opacity: .75; }
27
27
  .sl-workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr) minmax(0, 1fr); grid-template-areas: "left field right" "left notes right" "left readouts right" "catalog catalog catalog" "inspector inspector inspector"; align-items: start; gap: 20px 24px; }
28
- .sl-controls { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
28
+ .sl-controls { min-width: 0; display: flex; flex-direction: column; gap: 26px; padding: 12px 4px; }
29
29
  .sl-controls-left { grid-area: left; }
30
30
  .sl-controls-right { grid-area: right; }
31
31
  .sl-factor-group { min-width: 0; border: 0; padding: 0; margin: 0; }
32
- .sl-factor-group + .sl-factor-group { padding-top: 16px; border-top: 1px solid var(--sl-rule); }
33
- .sl-factor-group legend { width: 100%; padding: 0; margin-bottom: 8px; font-size: 13px; line-height: 1.5; font-weight: 600; }
32
+ .sl-factor-group + .sl-factor-group { padding-top: 4px; }
33
+ .sl-factor-group legend { width: 100%; padding: 0; margin-bottom: 8px; font-size: 16px; line-height: 1.5; font-weight: 600; }
34
34
  .sl-factor + .sl-factor { margin-top: 12px; }
35
- .sl-factor-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; }
36
- .sl-factor-row label { grid-column: 1; grid-row: 1; font-size: 13px; line-height: 18px; overflow-wrap: normal; }
35
+ .sl-factor-row { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(55%); align-items: center; column-gap: 8px; }
36
+ .sl-factor-row label { grid-column: 1; grid-row: 1; font-size: 13px; line-height: 18px; }
37
37
  .sl-factor-row input[type="range"] { grid-column: 1 / -1; grid-row: 2; appearance: none; -webkit-appearance: none; display: block; width: 100%; min-width: 0; height: 44px; padding: 0; margin: 0; border: 0; background: transparent; accent-color: var(--sl-accent); cursor: pointer; }
38
38
  .sl-factor-row input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--sl-accent) 0 var(--sl-progress), var(--sl-track) var(--sl-progress) 100%); }
39
39
  .sl-factor-row input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: var(--sl-track); }
40
40
  .sl-factor-row input[type="range"]::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--sl-accent); }
41
41
  .sl-factor-row input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin-top: -6px; border: 0; border-radius: 50%; background: var(--sl-accent); }
42
42
  .sl-factor-row input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--sl-accent); }
43
- .sl-factor-row output { grid-column: 2; grid-row: 1; font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; text-align: right; opacity: .8; }
43
+ .sl-factor-row output { grid-column: 2; grid-row: 1; font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; opacity: .8; }
44
44
  .sl-factor-help { min-width: 0; }
45
45
  .sl-factor-help summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; width: 100%; cursor: pointer; font-size: 10px; color: var(--sl-accent); list-style: none; }
46
46
  .sl-factor-help summary::-webkit-details-marker { display: none; }
@@ -52,30 +52,30 @@
52
52
  .sl-help-timescale { opacity: .8; }
53
53
  .sl-factor-help ul { margin: 8px 0 0; padding: 0; list-style: none; }
54
54
  .sl-factor-help a { display: inline-flex; align-items: center; min-height: 32px; font-size: 10px; line-height: 1.5; color: var(--sl-accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
55
- .sl-field { grid-area: field; min-width: 0; }
55
+ .sl-field { grid-area: field; min-width: 0; padding: clamp(14px, 1.5cqi, 22px); background: radial-gradient(ellipse at 4% 45%, #eaf6f9, transparent 62%), linear-gradient(140deg, var(--sl-paper), #f2f0fa); border-radius: 24px; }
56
56
  .sl-sample-notes { grid-area: notes; min-width: 0; }
57
57
  .sl-sample-notes > :first-child { margin-top: 0; }
58
- .sl-sample-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding-bottom: 9px; border-bottom: 1px solid var(--sl-rule); }
58
+ .sl-sample-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding-bottom: 9px; }
59
59
  .sl-sample-bar > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
60
- .sl-sample-bar h2 { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 600; }
60
+ .sl-sample-bar h2 { margin: 0; font-size: 18px; line-height: 1.5; font-weight: 600; }
61
61
  .sl-sample-bar span { font-size: 10px; opacity: .75; }
62
62
  .sl-concentration { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 9px; margin-top: 10px; }
63
63
  .sl-concentration > span { font-size: 11px; }
64
- .sl-concentration output { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
64
+ .sl-concentration output { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--sl-accent); }
65
65
  .sl-concentration small { flex-basis: 100%; font-size: 10px; line-height: 1.5; opacity: .75; }
66
66
  .sl-teaching-population { margin: 7px 0 0; font-size: 10px; line-height: 1.6; opacity: .8; }
67
67
  .sl-actions { display: flex; gap: 4px; }
68
- .sl-actions button { border: 0; padding-inline: 8px; }
69
- .sl-actions .sl-explore { border: 1px solid var(--sl-rule); }
70
- .sl-actions .sl-explore[aria-pressed="true"] { color: var(--sl-accent); background: color-mix(in oklch, var(--sl-clay) 14%, transparent); }
71
- .sl-canvas-wrap { position: relative; width: 100%; aspect-ratio: 1.35; min-height: 300px; max-height: 480px; }
68
+ .sl-actions button { padding-inline: 12px; background: transparent; }
69
+ .sl-actions .sl-explore { background: color-mix(in srgb, var(--sl-accent) 9%, var(--sl-paper)); color: var(--sl-accent); }
70
+ .sl-actions .sl-explore[aria-pressed="true"] { color: white; border-color: var(--sl-accent); background: var(--sl-accent); }
71
+ .sl-canvas-wrap { position: relative; width: 100%; aspect-ratio: 1.35; min-height: 300px; max-height: 480px; margin-top: 12px; background: transparent; }
72
72
  .sl-canvas-wrap canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: pan-y pinch-zoom; }
73
73
  .sl-canvas-wrap canvas:active { cursor: grabbing; }
74
74
  .sl-canvas-wrap canvas:focus-visible { outline-offset: -4px; }
75
75
  .sl-canvas-wrap[data-popup="true"] { min-height: max(300px, var(--sl-popup-min-height, 0px)); max-height: none; }
76
76
  .sl-popup-connector { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
77
77
  .sl-popup-connector line { stroke: var(--sl-accent); stroke-width: 1; stroke-dasharray: 3 3; opacity: .65; }
78
- .sl-cell-popup { position: absolute; top: 0; left: 0; z-index: 3; width: 260px; max-width: calc(100% - 16px); padding: 0 12px 8px; border: 1px solid var(--sl-rule); border-radius: 4px; background: var(--sl-paper); color: var(--sl-ink); visibility: hidden; }
78
+ .sl-cell-popup { position: absolute; top: 0; left: 0; z-index: 3; width: 260px; max-width: calc(100% - 16px); padding: 0 12px 8px; border: 0; border-radius: 18px; box-shadow: 0 3px 18px rgb(23 36 58 / 11%); background: var(--sl-paper); color: var(--sl-ink); visibility: hidden; }
79
79
  .sl-cell-popup > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
80
80
  .sl-cell-popup h3 { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; }
81
81
  .sl-cell-popup .sl-popup-close { display: grid; place-items: center; min-width: 44px; min-height: 44px; margin-right: -8px; padding: 8px; border: 0; }
@@ -83,7 +83,7 @@
83
83
  .sl-popup-details dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 0; }
84
84
  .sl-popup-details dt { font-size: 9px; line-height: 1.4; opacity: .75; }
85
85
  .sl-popup-details dd { margin: 2px 0 0; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
86
- .sl-popup-traits { display: grid; gap: 8px; padding: 10px 0 0; margin: 10px 0 0; border-top: 1px solid var(--sl-rule); list-style: none; }
86
+ .sl-popup-traits { display: grid; gap: 8px; padding: 10px 0 0; margin: 10px 0 0; list-style: none; }
87
87
  .sl-popup-traits strong, .sl-popup-traits span { display: block; }
88
88
  .sl-popup-traits strong { font-size: 10px; font-weight: 600; line-height: 1.4; }
89
89
  .sl-popup-traits span { margin-top: 2px; font-size: 10px; line-height: 1.5; }
@@ -91,23 +91,23 @@
91
91
  .sl-cell-popup .sl-popup-anatomy { min-height: 44px; margin-top: 7px; padding: 7px 0; border: 0; color: var(--sl-accent); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
92
92
  .sl-canvas-help { margin: 6px 0 0; font-size: 11px; line-height: 1.6; }
93
93
  .sl-sample-tools { display: flex; flex-wrap: wrap; gap: 5px 7px; margin-top: 10px; }
94
- .sl-sample-tools button { flex: 1 1 auto; padding-inline: 8px; font-size: 11px; }
94
+ .sl-sample-tools button { flex: 1 1 auto; background: var(--sl-paper); color: var(--sl-accent); padding-inline: 8px; font-size: 11px; }
95
95
  .sl-display { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 7px; }
96
96
  .sl-display label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 11px; cursor: pointer; }
97
97
  .sl-display input { width: 15px; height: 15px; margin: 0; accent-color: var(--sl-accent); }
98
98
  .sl-overlay-note, .sl-model-note { margin: 2px 0 0; font-size: 10px; line-height: 1.6; opacity: .8; }
99
- .sl-readouts { grid-area: readouts; min-width: 0; padding-top: 16px; border-top: 1px solid var(--sl-rule); }
99
+ .sl-readouts { grid-area: readouts; min-width: 0; padding: 6px 4px; }
100
100
  .sl-readouts h2, .sl-inspector h2, .sl-mechanisms h2 { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 600; }
101
101
  .sl-readouts dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0 0; }
102
102
  .sl-readouts dt { font-size: 10px; opacity: .75; overflow-wrap: anywhere; }
103
- .sl-readouts dd { margin: 3px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
103
+ .sl-readouts dd { margin: 3px 0 0; font-size: 18px; font-variant-numeric: tabular-nums; }
104
104
  .sl-readouts h3 { margin: 17px 0 0; font-size: 12px; line-height: 1.5; font-weight: 600; }
105
105
  .sl-legend-help { margin: 5px 0 0; font-size: 10px; opacity: .8; }
106
- .sl-catalog { grid-area: catalog; min-width: 0; padding-top: 17px; border-top: 1px solid var(--sl-rule); }
106
+ .sl-catalog { grid-area: catalog; min-width: 0; padding: 18px 0 0; }
107
107
  .sl-catalog h2 { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 600; }
108
108
  .sl-catalog header > p { margin: 7px 0 0; font-size: 11px; line-height: 1.6; }
109
109
  .sl-defect-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; margin-top: 12px; }
110
- .sl-defect-catalog button { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 82px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--sl-rule); border-radius: 0; text-align: left; }
110
+ .sl-defect-catalog button { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 82px; padding: 10px 6px; border: 0; border-radius: 12px; text-align: left; background: transparent; }
111
111
  .sl-specimen-thumbnail { flex: 0 0 96px; width: 96px; height: 42px; overflow: visible; }
112
112
  .sl-specimen-thumbnail :is(path, ellipse) { vector-effect: non-scaling-stroke; }
113
113
  .sl-specimen-thumbnail .sl-anatomy-tail { stroke-width: .85; }
@@ -123,15 +123,15 @@
123
123
  .sl-catalog-copy > span { display: block; margin-top: 4px; font-size: 10px; line-height: 1.5; opacity: .8; }
124
124
  .sl-defect-catalog button > b { align-self: start; margin-top: 2px; font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 400; }
125
125
  .sl-defect-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; margin-top: 8px; }
126
- .sl-defect-legend button { display: flex; align-items: center; gap: 5px; border: 0; border-bottom: 1px solid var(--sl-rule); border-radius: 0; padding: 7px 0; text-align: left; font-size: 10px; }
126
+ .sl-defect-legend button { display: flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; padding: 7px 4px; text-align: left; font-size: 10px; background: transparent; }
127
127
  .sl-defect-legend svg { flex-shrink: 0; width: 25px; height: 22px; fill: none; stroke: var(--sl-clay); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
128
128
  .sl-defect-legend b { margin-left: auto; font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
129
- .sl-inspector { grid-area: inspector; min-width: 0; padding-top: 18px; border-top: 1px solid var(--sl-rule); }
129
+ .sl-inspector { grid-area: inspector; min-width: 0; padding-top: 18px; }
130
130
  .sl-inspector > header { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
131
131
  .sl-inspector > header p { margin: 0; font-size: 12px; opacity: .8; }
132
132
  .sl-inspector-content { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 10px; }
133
133
  .sl-anatomy { display: block; width: 100%; max-width: 650px; color: var(--sl-ink); overflow: visible; }
134
- .sl-anatomy text { fill: currentColor; font: 12px Arial, Helvetica, sans-serif; }
134
+ .sl-anatomy text { fill: currentColor; font: 12px system-ui, -apple-system, "Segoe UI", sans-serif; }
135
135
  .sl-anatomy .sl-diagram-caption { font-size: 9px; opacity: .7; }
136
136
  .sl-anatomy-lines { fill: none; stroke: var(--sl-rule); stroke-width: 1; }
137
137
  .sl-anatomy-tail { fill: none; stroke: var(--sl-ink); stroke-width: 1.6; stroke-linecap: round; }
@@ -168,7 +168,7 @@
168
168
  .sl-mechanisms li strong { font-size: 12px; font-weight: 600; }
169
169
  .sl-mechanisms li span { margin-top: 4px; }
170
170
  .sl-mechanisms li small { margin-top: 5px; color: var(--sl-accent); font-size: 10px; }
171
- .sl-prepared-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--sl-rule); }
171
+ .sl-prepared-note { margin-top: 12px; padding-top: 10px; }
172
172
  .sl-prepared-note p { margin: 0; font-size: 11px; }
173
173
  @container sperm-lab (max-width: 1000px) {
174
174
  .sl-workbench { grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr) minmax(0, 1fr); gap: 18px 18px; }
@@ -178,7 +178,6 @@
178
178
  @container sperm-lab (max-width: 800px) {
179
179
  .sl-workbench { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "field field" "left right" "readouts readouts" "notes notes" "catalog catalog" "inspector inspector"; gap: 22px; }
180
180
  .sl-defect-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
181
- .sl-controls { padding-top: 18px; border-top: 1px solid var(--sl-rule); }
182
181
  .sl-factor-row input[type="range"] { min-height: 44px; }
183
182
  .sl-factor-help summary { min-height: 36px; }
184
183
  .sl-canvas-wrap { min-height: 300px; max-height: 450px; aspect-ratio: 1.6; }
@@ -204,6 +203,8 @@
204
203
  .sl-sample-tools button { font-size: 10px; }
205
204
  }
206
205
  @media (pointer: coarse) { .sl-factor-row input[type="range"], .sl-factor-help summary { min-height: 44px; } }
206
+ @media (prefers-reduced-motion: no-preference) { .sl-lab button { transition: background-color 140ms ease-out, color 140ms ease-out; } }
207
+ @media (forced-colors: active) { .sl-lab button[aria-pressed="true"], .sl-cell-popup { outline: 1px solid Highlight; } }
207
208
  @media (forced-colors: active) {
208
209
  .sl-lab { --sl-ink: CanvasText; --sl-accent: LinkText; --sl-rule: CanvasText; }
209
210
  .sl-canvas-wrap { border: 1px solid CanvasText; }
package/docs/API.md CHANGED
@@ -55,6 +55,7 @@ All factor strengths default to zero.
55
55
  The older `initialFactor` option starts that factor at a strength of 0.65.
56
56
  All 12 native factor sliders remain visible.
57
57
  Each slider changes its own value in the combined sample.
58
+ The sliders show example quantities or scenario levels. The component converts slider changes to strengths from 0 to 1.
58
59
 
59
60
  `onMetrics` receives one `Metrics` object after the initial mount and population changes.
60
61
  It does not run for every animation frame.
package/docs/MODEL.md CHANGED
@@ -49,7 +49,8 @@ The lab identifies uncertain scenarios as possible-pathway examples.
49
49
 
50
50
  Every numerical parameter in a scenario is an authored teaching value.
51
51
  The parameters do not fit clinical data.
52
- Factor strength does not represent drinks, cigarettes, kilometers, degrees, or chemical concentration.
52
+ The React controls use example quantities such as cigarettes per day and nights of disrupted sleep per week.
53
+ These quantities select relative strengths in the core. The model does not estimate a clinical response to an exposure.
53
54
  The core progress option does not represent a clinical recovery period.
54
55
  The React component applies the current factor settings at progress 1.
55
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esmirnov.ai/sperm-lab",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "An interactive sperm education lab with 12 factors, a headless TypeScript simulation, and an embeddable React component.",
5
5
  "type": "module",
6
6
  "license": "MIT",