1:root {
2 --bg: #fafaf7;
3 --fg: #1d1d1f;
4 --accent: #2f5d8a;
5 --force: #c0392b;
6 --momentum: #2e8b57;
7 --potential: #c98a1b;
8}
10@media (prefers-color-scheme: dark) {
11 :root {
12 --bg: #141416;
13 --fg: #e8e8ea;
14 --accent: #7fb0e0;
15 --force: #ec7063;
16 --momentum: #58d68d;
17 --potential: #f0b450;
18 }
19}
21* { box-sizing: border-box; }
23body {
24 margin: 0;
25 background: var(--bg);
26 color: var(--fg);
27 font-family: system-ui, -apple-system, sans-serif;
28}
30main {
31 min-height: 100vh;
32 display: flex;
33 align-items: flex-start;
34 justify-content: center;
35 padding: 64px 16px 16px;
36}
38/* Slide titles sit at the top; only the title slide is centered vertically. */
39#landing { align-self: center; }
41.page { display: none; text-align: center; width: 100%; max-width: 720px; }
42.page.active { display: block; }
44/* Slides: text and equations on the left, interactive content on the right.
45 On narrow screens they stack, with the interactive part first. */
46.page.split, .page.text-only { max-width: 1200px; }
48.page.split.active {
49 display: grid;
50 grid-template-columns: 1fr 1fr;
51 grid-template-areas: "title title" "text demo";
52 gap: 0 3rem;
53 align-items: start;
54}
56.page.split > h2 { grid-area: title; }
57.page.split > .text { grid-area: text; text-align: left; }
58.page.split > .demo { grid-area: demo; min-width: 0; }
60/* On desktop the slide fills the window below the nav bar, and the two
61 panels scroll independently. */
62@media (min-width: 861px) {
63 .page.split.active {
64 height: calc(100vh - 64px - 16px);
65 grid-template-rows: auto minmax(0, 1fr);
66 }
67 .page.split > .text,
68 .page.split > .demo {
69 height: 100%;
70 overflow-y: auto;
71 padding: 0 8px 16px;
72 }
73}
75@media (max-width: 860px) {
76 .page.split.active {
77 grid-template-columns: 1fr;
78 grid-template-areas: "title" "demo" "text";
79 }
80 .page.split > .text { margin-top: 1.5rem; }
81}
83.pager {
84 position: fixed;
85 top: 0;
86 left: 0;
87 right: 0;
88 z-index: 1;
89 display: flex;
90 align-items: center;
91 justify-content: space-between;
92 padding: 10px 16px;
93 background: var(--bg);
94 border-bottom: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
95}
97.pager button { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
98.pager button:disabled { opacity: 0.3; cursor: default; background: none; color: var(--accent); }
99#nav-pos { font-size: 0.85rem; opacity: 0.6; }
101h2 {
102 font-weight: 500;
103 font-size: clamp(1.2rem, 4vw, 1.6rem);
104 margin: 0 0 1.5rem;
105}
107canvas {
108 display: block;
109 width: 100%;
110 height: 200px;
111 margin: 0 0 1.5rem;
112}
114/* A diagram with its Start/Stop button in the top-right corner. */
115.stage { position: relative; }
116.stage > canvas { margin-bottom: 0; }
117.stage + * { margin-top: 1.5rem; }
118button.run {
119 position: absolute;
120 top: 0;
121 right: 0;
122 padding: 0.3rem 0.8rem;
123 font-size: 0.9rem;
124 background: var(--bg);
125}
126button.run:hover { background: var(--accent); }
128canvas.bars { height: 100px; margin-top: -0.5rem; }
129canvas.phase { height: 260px; }
130canvas.pendulum { height: 260px; }
131canvas.pendulum-centered { height: 240px; }
133.preset { display: inline-flex; align-items: center; gap: 0.5rem; }
135select {
136 font: inherit;
137 color: var(--fg);
138 background: var(--bg);
139 border: 1px solid var(--accent);
140 border-radius: 6px;
141 padding: 0.35rem 0.5rem;
142}
144.q0-row { text-align: left; margin-top: -1.25rem; }
145.q0-row input { display: block; margin: 0; }
146.slider-caption { margin: 0.25rem 0 1rem; font-size: 0.9rem; opacity: 0.8; }
148/* Grouped sliders: symbol, slider and value line up in columns. */
149.control-groups {
150 display: grid;
151 grid-template-columns: 1fr 1fr;
152 gap: 1rem;
153 margin: 0 0 1.25rem;
154 text-align: left;
155}
157@media (max-width: 560px) {
158 .control-groups { grid-template-columns: 1fr; }
159}
161.control-groups.single { grid-template-columns: 1fr; max-width: 340px; margin-left: auto; margin-right: auto; }
163.control-groups fieldset {
164 display: grid;
165 grid-template-columns: 1.5em 1fr 3em;
166 align-items: center;
167 gap: 0.4rem 0.6rem;
168 align-content: start;
169 margin: 0;
170 padding: 0.6rem 0.9rem 0.8rem;
171 border: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
172 border-radius: 8px;
173}
175.control-groups legend { padding: 0 0.3rem; font-size: 0.85rem; opacity: 0.7; }
176.control-groups .row { display: contents; }
177.control-groups input { width: 100%; margin: 0; }
178.control-groups output { text-align: right; font-variant-numeric: tabular-nums; }
180input[type="range"] { accent-color: var(--accent); }
182h1 {
183 font-weight: 500;
184 font-size: clamp(1.6rem, 5vw, 2.6rem);
185 margin: 0 0 1.5rem;
186}
188button {
189 font: inherit;
190 color: var(--accent);
191 background: none;
192 border: 1px solid var(--accent);
193 border-radius: 6px;
194 padding: 0.6rem 1.2rem;
195 cursor: pointer;
196}
198button:hover { background: var(--accent); color: var(--bg); }
200/* The suggested next step: hidden until the user has tried the demo, then filled and pulsing gently. */
201button.next {
202 margin-top: 1.5rem;
203 background: var(--accent);
204 color: var(--bg);
205 visibility: hidden;
206 opacity: 0;
207 transition: opacity 0.6s;
208}
210button.next.ready {
211 visibility: visible;
212 opacity: 1;
213 animation: pulse 2s ease-in-out 0.6s 3;
214}
216button.next:hover { opacity: 0.85; }
218@keyframes pulse {
219 0%, 100% { box-shadow: 0 0 0 0 var(--accent); }
220 50% { box-shadow: 0 0 0 6px transparent; }
221}
223.equations {
224 text-align: left;
225 margin: 0;
226 line-height: 1.6;
227 display: grid;
228 grid-template-columns: 1fr 1fr;
229 gap: 0 2.5rem;
230}
232.equations[hidden] { display: none; }
234.equations > div > :first-child { margin-top: 0; }
236/* Two columns of equations only when the text panel is wide enough. */
237@media (max-width: 1100px) and (min-width: 861px), (max-width: 600px) {
238 .equations { grid-template-columns: 1fr; }
239 .equations > div + div { margin-top: 1.5rem; }
240}
242.equations h3 {
243 font-weight: 500;
244 font-size: 1.05rem;
245 margin: 1.5rem 0 0.25rem;
246}
248button.link {
249 border: none;
250 padding: 0.3rem 0;
251 text-decoration: underline;
252 text-underline-offset: 3px;
253}
255button.link:hover { background: none; color: var(--accent); opacity: 0.8; }
257.exercise {
258 text-align: left;
259 margin: 2rem 0 0;
260 padding: 1rem 1.25rem;
261 border-left: 3px solid var(--accent);
262 line-height: 1.6;
263}
265.exercise h3 {
266 font-weight: 500;
267 font-size: 1.05rem;
268 margin: 0 0 0.25rem;
269}
271.defs {
272 list-style: none;
273 padding: 0;
274 margin: 0;
275}
277.defs li { margin: 0.35rem 0; }