7212d95Hardening and softening tutorialJeremy Magland 1/* Styled after the CCM PowerPoint template (2025): navy text on white, Flatiron
2 orange and blue accents, Tiempos Headline titles and Founders Grotesk body text.
3 The brand fonts are used when installed; otherwise the bundled open fonts
4 Source Serif 4 and Hanken Grotesk stand in. */
5@font-face { font-family: "Source Serif 4"; font-weight: 300; src: url("vendor/fonts/source-serif-4-latin-300-normal.woff2") format("woff2"); }
6@font-face { font-family: "Source Serif 4"; font-weight: 400; src: url("vendor/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
7@font-face { font-family: "Hanken Grotesk"; font-weight: 400; src: url("vendor/fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
8@font-face { font-family: "Hanken Grotesk"; font-weight: 600; src: url("vendor/fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
9@font-face { font-family: "Hanken Grotesk"; font-weight: 700; src: url("vendor/fonts/hanken-grotesk-latin-700-normal.woff2") format("woff2"); }
11/* Slides keep the template's light colors in both themes; only the window
12 around them and the nav bar follow the system theme. */
13:root {
14 --bg: #ffffff;
15 --fg: #1c2954;
16 --accent: #537eba;
17 --brand-orange: #f6862d;
18 --force: #c0392b;
19 --momentum: #2e8b57;
20 --potential: #c98a1b;
21 --font-head: "Tiempos Headline", "Source Serif 4", Georgia, serif;
22 --font-body: "Founders Grotesk", "Hanken Grotesk", system-ui, sans-serif;
23 --window-bg: #eef0f4;
24 --window-fg: #1c2954;
25}
27@media (prefers-color-scheme: dark) {
28 :root {
29 --window-bg: #141416;
30 --window-fg: #e8e8ea;
31 }
32}
34* { box-sizing: border-box; }
36body {
37 margin: 0;
38 background: var(--window-bg);
39 color: var(--window-fg);
40 font-family: var(--font-body);
41}
43/* The area above the nav bar (main.js sets bottom); the deck is scaled to fit inside it. */
44main {
45 position: fixed;
46 top: 0;
47 left: 0;
48 right: 0;
49 bottom: 0;
50 overflow: hidden;
51}
53/* Slides are laid out at 1920 x 1080 and scaled as a whole by main.js,
54 so sizes below are in slide pixels. */
55#deck {
56 position: absolute;
57 width: 1920px;
58 height: 1080px;
59 transform-origin: 0 0;
60}
62.page {
63 display: none;
64 position: absolute;
65 inset: 0;
66 background: var(--bg);
67 color: var(--fg);
68 border: 3px solid color-mix(in srgb, var(--fg) 35%, transparent);
69 text-align: center;
70}
72/* Content slides: the title on top and the content below it. */
73.page.active {
74 display: flex;
75 flex-direction: column;
76 padding: 84px 98px 40px;
77}
79/* Flatiron logo, added to every slide by main.js: top right as in the
80 template's content layouts, bottom right on the title slide. */
81.page > .logo { position: absolute; top: 30px; right: 98px; height: 42px; }
82#landing > .logo { top: auto; bottom: 90px; height: 50px; }
84/* Title slide: the template's white title layout, text left-aligned. */
85#landing.active {
86 align-items: flex-start;
87 justify-content: flex-start;
88 padding: 240px 98px 0;
89 text-align: left;
90}
92h1, h2 { font-family: var(--font-head); font-weight: 300; }
94h1 {
95 font-size: 108px;
96 line-height: 1.08;
97 max-width: 1400px;
98 margin: 0 0 120px;
99}
101h2 {
102 font-size: 76px;
103 line-height: 1.1;
104 text-align: left;
105 margin: 0 0 34px;
106}
108button.start { font-size: 40px; padding: 18px 44px; }
110/* Link on the title slide to the replay of how the recipe was written. */
111.crafted { margin-top: 64px; font-size: 28px; }
112.crafted a { color: inherit; opacity: 0.8; text-decoration: none; }
113.crafted a:hover { opacity: 1; text-decoration: underline; }
115/* Slides with a title on top, text on the left and the interactive content
116 on the right. Each panel scrolls on its own if its content is too tall. */
117.page.split.active {
118 display: grid;
119 grid-template-columns: 960px minmax(0, 1fr);
120 grid-template-rows: auto minmax(0, 1fr);
121 grid-template-areas: "title title" "text demo";
122 gap: 0 72px;
123 text-align: left;
124}
125/* Controls on the left need less room than equations. */
126.page.split.narrow-left.active { grid-template-columns: 600px minmax(0, 1fr); }
128.page.split > h2 { grid-area: title; }
129.page.split > .text { grid-area: text; }
130.page.split > .demo { grid-area: demo; min-width: 0; }
131.page.split > .text,
132.page.split > .demo { min-height: 0; overflow-y: auto; }
134/* Slides that are not split: the interactive content centered below the title. */
135.page:not(.split) > .demo { align-self: center; width: 1100px; }
137.text { font-size: 30px; line-height: 1.45; text-align: left; }
138.text p { margin: 0 0 16px; }
140h3 { font-weight: 600; font-size: 32px; margin: 28px 0 6px; }
142.katex-display { margin: 12px 0; }
144.equations {
145 display: grid;
146 grid-template-columns: 1fr 1fr;
147 gap: 0 56px;
148 text-align: left;
149}
150.equations > div > :first-child { margin-top: 0; }
152/* Text-only slides: a title and large equations, centered. */
153.page.text-only > .equations {
154 align-self: center;
155 width: 1500px;
156 margin-top: 40px;
157 font-size: 40px;
158 line-height: 1.45;
159}
160.page.text-only h3 { font-size: 42px; margin: 48px 0 10px; }
161.page.text-only p { margin: 0 0 16px; }
163.defs { list-style: none; padding: 0; margin: 0; }
164.defs li { margin: 6px 0; padding-left: 1.2em; text-indent: -1.2em; } /* wrapped lines indented */
166.exercise {
167 margin: 32px 0 0;
168 padding: 16px 28px;
169 border-left: 4px solid var(--accent);
170}
171.exercise h3 { margin-top: 0; }
173/* Interactive content: diagrams, plots and their controls, stacked. */
174.demo { display: flex; flex-direction: column; gap: 24px; text-align: center; }
175.demo > p { margin: 0; }
177canvas { display: block; width: 100%; height: 300px; }
178.caption { font-size: 26px; opacity: 0.8; }
179/* Oscillator pages: room for the longest definition on one line. */
180.page.split.oscillator-page.active { grid-template-columns: 700px minmax(0, 1fr); }
181canvas.oscillator { height: 260px; }
182canvas.spectrogram { height: 222px; }
183canvas.phase { height: 700px; }
184/* shorter while the spectrogram shows below it */
185.with-spectrogram canvas.phase { height: 440px; }
186/* The phase-space slide's controls: the presets dropdown above the sliders. */
187[data-phase-controls] .presets { margin: 0 0 24px; }
188/* The lab page's instrument controls, below the sliders. */
189.instrument-controls { margin-top: 36px; padding-top: 24px; border-top: 2px solid color-mix(in srgb, var(--fg) 12%, transparent); }
190.instrument-controls .preset { display: flex; width: 100%; margin-bottom: 16px; }
191.instrument-controls select { flex: 1; min-width: 0; font-size: 26px; }
192.instrument-controls select:disabled { opacity: 0.4; }
193.instrument-controls .sliders { font-size: 26px; }
194.check { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 26px; }
195.check input { width: 24px; height: 24px; accent-color: var(--accent); }
196/* Lab write-up pages: two columns of text, scrolling if needed. */
197.page.doc.active > .text { flex: 1; min-height: 0; overflow-y: auto; font-size: 25px; line-height: 1.45; }
198.page.doc .equations { gap: 0 64px; }
199.page.doc h3 { font-size: 28px; margin: 22px 0 6px; }
200.page.doc p { margin: 0 0 10px; }
201.page.doc .katex-display { margin: 8px 0; }
202.doc-list { margin: 0 0 10px; padding-left: 1.2em; }
203.doc-list li { margin: 4px 0; }
204canvas.responses { height: 520px; }
205canvas[hidden] { display: none; }
206.demo-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; font-size: 28px; }
207.demo-footer button.link { font-size: 28px; }
208.defs + div { margin-top: 28px; }
210/* Sliders under a diagram: label, slider and value line up in columns. */
211.sliders {
212 display: grid;
213 grid-template-columns: auto minmax(0, 1fr) 5.5em;
214 align-items: center;
215 gap: 6px 24px;
216 font-size: 30px;
217 text-align: left;
218}
219.sliders .row { display: contents; }
220.sliders input { width: 100%; }
221.sliders output { text-align: right; font-variant-numeric: tabular-nums; }
223button.run:disabled { opacity: 0.4; cursor: default; background: var(--bg); color: var(--accent); }
225/* A diagram with its Start/Stop and reset buttons in the top-right corner. */
226.stage { position: relative; }
227.run-controls { position: absolute; top: 0; right: 0; display: flex; gap: 10px; }
228button.run { font-size: 26px; padding: 6px 20px; background: var(--bg); }
229button.run:hover { background: var(--accent); color: var(--bg); }
230.run-controls select { font-size: 26px; }
232/* Volume next to Play: small and faint until used. */
233.volume { display: flex; align-items: center; gap: 6px; color: var(--accent); opacity: 0.55; transition: opacity 0.2s; }
234.volume:hover, .volume:focus-within { opacity: 1; }
235.volume svg { width: 28px; height: 28px; }
236.volume input[type="range"] { width: 110px; }
237.volume input[type="range"]::-webkit-slider-runnable-track { height: 4px; }
238.volume input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; }
239.volume input[type="range"]::-moz-range-track { height: 4px; }
240.volume input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; }
242.readout { font-size: 30px; font-variant-numeric: tabular-nums; }
244.preset { display: inline-flex; align-items: center; gap: 16px; }
245/* Presets dropdown: never wider than the panel, whatever its options. */
246.presets { margin-top: 28px; }
247.presets .preset { display: flex; width: 100%; }
248.presets select { flex: 1; min-width: 0; width: 100%; font-size: 26px; text-overflow: ellipsis; }
250select {
251 font: inherit;
252 color: var(--fg);
253 background: var(--bg);
254 border: 2px solid var(--accent);
255 border-radius: 8px;
256 padding: 6px 12px;
257}
259/* Grouped sliders: symbol, slider and value line up in columns. */
260.control-groups {
261 display: grid;
262 gap: 24px;
263 max-width: 520px;
264 margin: 0 0 28px;
265}
267.control-groups fieldset {
268 display: grid;
269 grid-template-columns: 1.5em 1fr 3.2em;
270 align-items: center;
271 gap: 10px 16px;
272 margin: 0;
273 padding: 14px 24px 20px;
274 border: 2px solid color-mix(in srgb, var(--fg) 15%, transparent);
275 border-radius: 12px;
276}
278.control-groups legend { padding: 0 8px; font-size: 24px; opacity: 0.7; }
279.control-groups .row { display: contents; }
280.control-groups input { width: 100%; }
281.control-groups output { text-align: right; font-variant-numeric: tabular-nums; }
283/* Sliders drawn large enough to use when the deck is scaled down. */
284input[type="range"] {
285 -webkit-appearance: none;
286 appearance: none;
287 height: 34px;
288 margin: 0;
289 background: transparent;
290 cursor: pointer;
291}
292input[type="range"]::-webkit-slider-runnable-track {
293 height: 8px;
294 border-radius: 4px;
295 background: color-mix(in srgb, var(--fg) 18%, transparent);
296}
297input[type="range"]::-webkit-slider-thumb {
298 -webkit-appearance: none;
299 width: 30px;
300 height: 30px;
301 margin-top: -11px;
302 border: none;
303 border-radius: 50%;
304 background: var(--accent);
305}
306input[type="range"]::-moz-range-track {
307 height: 8px;
308 border-radius: 4px;
309 background: color-mix(in srgb, var(--fg) 18%, transparent);
310}
311input[type="range"]::-moz-range-thumb {
312 width: 30px;
313 height: 30px;
314 border: none;
315 border-radius: 50%;
316 background: var(--accent);
317}
318input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
320.pager {
321 position: fixed;
322 bottom: 0;
323 left: 0;
324 right: 0;
325 z-index: 1;
326 display: flex;
327 align-items: center;
328 justify-content: space-between;
329 padding: 10px 16px;
330 background: var(--window-bg);
331 color: var(--window-fg);
332 border-top: 1px solid color-mix(in srgb, var(--window-fg) 12%, transparent);
333}
335.pager button { padding: 0.35rem 0.8rem; font-size: 0.9rem; border-width: 1px; }
336.pager button:disabled { opacity: 0.3; cursor: default; background: none; color: var(--accent); }
337/* Slide counter; opens the table of contents. */
338.pager .nav-toc { border-color: transparent; color: inherit; font-size: 0.85rem; opacity: 0.75; }
339.pager .nav-toc:hover, .pager .nav-toc[aria-expanded="true"] { opacity: 1; background: color-mix(in srgb, var(--window-fg) 10%, transparent); color: inherit; }
341/* Table of contents, opening upward from the nav bar. */
342.toc {
343 position: absolute;
344 bottom: calc(100% + 8px);
345 left: 50%;
346 transform: translateX(-50%);
347 width: min(460px, calc(100vw - 32px));
348 max-height: min(70vh, 560px);
349 overflow-y: auto;
350 padding: 6px;
351 border-radius: 10px;
352 border: 1px solid color-mix(in srgb, var(--window-fg) 18%, transparent);
353 background: var(--window-bg);
354 box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
355}
356.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: slide; }
357.toc li { counter-increment: slide; }
358.toc button {
359 display: flex;
360 gap: 12px;
361 width: 100%;
362 text-align: left;
363 border: none;
364 border-radius: 6px;
365 padding: 7px 10px;
366 font-size: 0.95rem;
367 color: var(--window-fg);
368}
369.toc button::before { content: counter(slide); min-width: 1.6em; text-align: right; opacity: 0.5; font-variant-numeric: tabular-nums; }
370.toc button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--window-fg); }
371.toc button.current { background: color-mix(in srgb, var(--accent) 22%, transparent); font-weight: 600; }
373button {
374 font: inherit;
375 color: var(--accent);
376 background: none;
377 border: 2px solid var(--accent);
378 border-radius: 8px;
379 padding: 10px 24px;
380 cursor: pointer;
381}
383button:hover { background: var(--accent); color: var(--bg); }
385/* The suggested next step: filled and pulsing gently. */
386button.next {
387 font-size: 32px;
388 padding: 14px 36px;
389 background: var(--accent);
390 color: var(--bg);
391 visibility: hidden;
392 opacity: 0;
393 transition: opacity 0.6s;
394}
396button.next.ready {
397 visibility: visible;
398 opacity: 1;
399 animation: pulse 2s ease-in-out 0.6s 3;
400}
402button.next:hover { opacity: 0.85; }
404@keyframes pulse {
405 0%, 100% { box-shadow: 0 0 0 0 var(--accent); }
406 50% { box-shadow: 0 0 0 12px transparent; }
407}
409button.link {
410 border: none;
411 padding: 4px 0;
412 text-decoration: underline;
413 text-underline-offset: 5px;
414}
416button.link:hover { background: none; color: var(--accent); opacity: 0.8; }
417.sliders .unit { font-size: 0.7em; opacity: 0.7; }
418/* Many sliders (the driven oscillator): smaller and closer together, so the
419 panel still fits with the spectrogram open. */
420.sliders.compact { font-size: 26px; row-gap: 0; }
421.sliders.compact input[type="range"] { height: 30px; }