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}
27967abLayout refinements for phase space pages and run buttonsJeremy Magland 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); }
51ce1cdInteractive Hamiltonian systems tutorialJeremy Magland 128canvas.bars { height: 100px; margin-top: -0.5rem; }
129canvas.phase { height: 260px; }
1aac419Add Liouville pages, crafted-by-human link and CLAUDE.mdJeremy Magland 130.readout { font-variant-numeric: tabular-nums; }
132canvas.pendulum-centered { height: 240px; }
134.preset { display: inline-flex; align-items: center; gap: 0.5rem; }
136select {
137 font: inherit;
138 color: var(--fg);
139 background: var(--bg);
140 border: 1px solid var(--accent);
141 border-radius: 6px;
142 padding: 0.35rem 0.5rem;
143}
145.q0-row { text-align: left; margin-top: -1.25rem; }
146.q0-row input { display: block; margin: 0; }
147.slider-caption { margin: 0.25rem 0 1rem; font-size: 0.9rem; opacity: 0.8; }
27967abLayout refinements for phase space pages and run buttonsJeremy Magland 149/* Grouped sliders: symbol, slider and value line up in columns. */
150.control-groups {
151 display: grid;
152 grid-template-columns: 1fr 1fr;
153 gap: 1rem;
156}
158@media (max-width: 560px) {
159 .control-groups { grid-template-columns: 1fr; }
160}
162.control-groups.single { grid-template-columns: 1fr; max-width: 340px; margin-left: auto; margin-right: auto; }
164.control-groups fieldset {
165 display: grid;
166 grid-template-columns: 1.5em 1fr 3em;
167 align-items: center;
168 gap: 0.4rem 0.6rem;
169 align-content: start;
170 margin: 0;
171 padding: 0.6rem 0.9rem 0.8rem;
172 border: 1px solid color-mix(in srgb, var(--fg) 15%, transparent);
173 border-radius: 8px;
27967abLayout refinements for phase space pages and run buttonsJeremy Magland 176.control-groups legend { padding: 0 0.3rem; font-size: 0.85rem; opacity: 0.7; }
177.control-groups .row { display: contents; }
178.control-groups input { width: 100%; margin: 0; }
179.control-groups output { text-align: right; font-variant-numeric: tabular-nums; }
51ce1cdInteractive Hamiltonian systems tutorialJeremy Magland 180
181input[type="range"] { accent-color: var(--accent); }
183h1 {
184 font-weight: 500;
185 font-size: clamp(1.6rem, 5vw, 2.6rem);
186 margin: 0 0 1.5rem;
187}
1aac419Add Liouville pages, crafted-by-human link and CLAUDE.mdJeremy Magland 189/* Link on the title slide to the replay of how the recipe was written. */
190.crafted { margin-top: 2.5rem; font-size: 0.9rem; }
191.crafted a { color: var(--fg); opacity: 0.6; text-decoration: none; }
192.crafted a:hover { opacity: 1; text-decoration: underline; }
195 font: inherit;
196 color: var(--accent);
197 background: none;
198 border: 1px solid var(--accent);
199 border-radius: 6px;
200 padding: 0.6rem 1.2rem;
201 cursor: pointer;
202}
204button:hover { background: var(--accent); color: var(--bg); }
206/* The suggested next step: hidden until the user has tried the demo, then filled and pulsing gently. */
207button.next {
208 margin-top: 1.5rem;
209 background: var(--accent);
210 color: var(--bg);
211 visibility: hidden;
212 opacity: 0;
213 transition: opacity 0.6s;
214}
216button.next.ready {
217 visibility: visible;
218 opacity: 1;
219 animation: pulse 2s ease-in-out 0.6s 3;
220}
222button.next:hover { opacity: 0.85; }
224@keyframes pulse {
225 0%, 100% { box-shadow: 0 0 0 0 var(--accent); }
226 50% { box-shadow: 0 0 0 6px transparent; }
227}
229.equations {
230 text-align: left;
231 margin: 0;
232 line-height: 1.6;
233 display: grid;
234 grid-template-columns: 1fr 1fr;
235 gap: 0 2.5rem;
236}
238.equations[hidden] { display: none; }
240.equations > div > :first-child { margin-top: 0; }
242/* Two columns of equations only when the text panel is wide enough. */
243@media (max-width: 1100px) and (min-width: 861px), (max-width: 600px) {
244 .equations { grid-template-columns: 1fr; }
245 .equations > div + div { margin-top: 1.5rem; }
246}
248.equations h3 {
249 font-weight: 500;
250 font-size: 1.05rem;
251 margin: 1.5rem 0 0.25rem;
252}
254button.link {
255 border: none;
256 padding: 0.3rem 0;
257 text-decoration: underline;
258 text-underline-offset: 3px;
259}
261button.link:hover { background: none; color: var(--accent); opacity: 0.8; }
263.exercise {
264 text-align: left;
265 margin: 2rem 0 0;
266 padding: 1rem 1.25rem;
267 border-left: 3px solid var(--accent);
268 line-height: 1.6;
269}
271.exercise h3 {
272 font-weight: 500;
273 font-size: 1.05rem;
274 margin: 0 0 0.25rem;
275}
277.defs {
278 list-style: none;
279 padding: 0;
280 margin: 0;
281}
283.defs li { margin: 0.35rem 0; }