-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathstyle.css
More file actions
1771 lines (1708 loc) · 49.6 KB
/
Copy pathstyle.css
File metadata and controls
1771 lines (1708 loc) · 49.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
:root, [data-theme="light"] {
--bg: #e8edf3;
--card-bg-rgb: 255, 255, 255;
--border: rgba(255, 255, 255, 0.4);
--text: #1a1a1a;
--text-secondary: #555;
--accent: #2563eb;
/* Foreground text color to use on top of --accent background.
White on #2563eb in light mode = ~5.2:1 (passes WCAG AA).
Set explicitly so dark-mode override is a single-property change. */
--accent-on: #ffffff;
--band: rgba(37, 99, 235, 0.18);
--pareto: #e11d48;
/* Foreground for text ON the pareto pill, same pattern as --accent-on.
White on #e11d48 is 4.70:1, which clears WCAG AA for the pill's 9.6 px
bold text (not "large text", so the bar is 4.5:1, not 3:1). */
--pareto-on: #ffffff;
--observation: #475569;
--point: #475569;
--glass-bg: rgba(var(--card-bg-rgb), 0.7);
--glass-blur: 4px;
--canvas-axis: #1e293b;
--canvas-text: #1e293b;
}
[data-theme="dark"] {
--bg: #1a1a2e;
--card-bg-rgb: 42, 42, 62;
--border: rgba(255, 255, 255, 0.12);
--text: #e2e2e2;
--text-secondary: #aaa;
--accent: #60a5fa;
/* White on #60a5fa is only 2.54:1 (fails WCAG AA). Use dark text for ~8.2:1. */
--accent-on: #0f0f1a;
--band: rgba(96, 165, 250, 0.2);
--pareto: #fb7185;
/* White on #fb7185 is only 2.69:1 and FAILED WCAG AA at the pill's 9.6 px
bold size. Keep the bright chip -- it needs to read against a dark panel
-- and darken the text instead, exactly as --accent-on does: 5.81:1. */
--pareto-on: #4c0519;
--observation: #94a3b8;
--point: #94a3b8;
--glass-bg: rgba(var(--card-bg-rgb), 0.7);
--glass-blur: 6px;
--canvas-axis: #e2e8f0;
--canvas-text: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* Global theme transition — ensures all color changes are smooth */
body, .panel, .site-header, .theme-toggle, .unit-toggle,
.toggle-btn, .controls, .readouts, .filter-row select,
.filter-row input, .filter-row button, #filter-clear {
transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease,
backdrop-filter 0.5s ease;
}
html {
background-color: var(--bg);
min-height: 100%;
/* Prevent horizontal pan on mobile — panels with negative side margins or
wide intrinsic content (canvases, sticky header) would otherwise let the
viewport scroll left/right, exposing the header endpoints.
Use `clip` instead of `hidden` so we don't establish a new scroll
container — that would break `position: sticky` on the header in iOS
Safari (a long-standing WebKit quirk). */
overflow-x: clip;
overscroll-behavior-x: none;
transition: background-color 0.5s ease;
}
[data-theme="dark"] {
background-color: #0f0f1a;
}
/* Fixed background layer — doesn't resize with content */
.bg-layer {
position: fixed;
inset: 0;
z-index: -1;
background-image: url('Q1000572_opt.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
transition: opacity 0.5s ease;
}
[data-theme="dark"] .bg-layer {
background-image: url('concrete_poster.jpg');
}
body {
font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
font-weight: 400;
background: transparent;
color: var(--text);
line-height: 1.5;
padding: 0 1rem 1rem;
min-height: 100vh;
position: relative;
/* Same horizontal lock as <html> — belt-and-braces for iOS Safari which
sometimes ignores html overflow when the body is the scroll container.
Use `clip` (not `hidden`) so the body doesn't become a scroll container
that would break the sticky header. */
overflow-x: clip;
overscroll-behavior-x: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Frosted glass header */
.site-header {
display: flex;
align-items: center;
gap: 1.2rem;
padding: 0.6rem 1.5rem;
margin: 0 -1rem 1rem;
background: var(--glass-bg);
backdrop-filter: blur(var(--glass-blur));
-webkit-backdrop-filter: blur(var(--glass-blur));
box-shadow: 0 1px 0 0 var(--border);
position: sticky;
top: 0;
z-index: 50;
}
.site-header h1 {
font-size: 1.3rem;
margin: 0;
font-family: "DM Sans", "Inter", sans-serif;
font-weight: 700;
letter-spacing: -0.02em;
background: linear-gradient(90deg, #3b82f6, #60a5fa, #a78bfa, #60a5fa, #3b82f6);
background-size: 200% 100%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: gradientShift 30s linear infinite;
}
@keyframes gradientShift {
0% { background-position: 200% center; }
100% { background-position: 0% center; }
}
.header-tagline {
font-size: 0.82rem;
color: var(--text-secondary);
letter-spacing: -0.01em;
}
.header-links {
position: absolute;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
gap: 2rem;
font-size: 0.88rem;
}
.header-links a {
color: var(--text-secondary);
text-decoration: none;
font-weight: 500;
letter-spacing: 0.01em;
transition: color 0.15s;
}
.header-links a:hover {
color: var(--accent);
}
.cite-btn {
font-size: 0.72rem;
padding: 5px 10px;
border-radius: 999px;
border: 1px solid var(--border);
background: transparent;
color: var(--text-secondary);
cursor: pointer;
font-weight: 600;
min-width: 3.5rem;
text-align: center;
transition: background 0.05s, color 0.05s, border-color 0.05s;
}
.cite-btn:hover {
border-color: var(--accent);
color: var(--accent);
}
/*
* Note: backdrop-filter on nested elements inside already-blurred containers
* (header, panels) produces no visible effect — browsers don't compose nested
* backdrop-filters. The cite buttons use a simple semi-transparent background
* instead.
*/
.cite-group {
display: inline-flex;
align-items: center;
gap: 0.15rem;
padding: 0;
border-radius: 999px;
border: 1px solid var(--border);
background: rgba(var(--card-bg-rgb), 0.5);
}
.header-actions {
margin-left: auto;
display: flex;
align-items: center;
gap: 0.8rem;
}
.cite-group .cite-btn {
border: none;
padding: 5px 10px;
background: rgba(var(--card-bg-rgb), 0.6);
min-width: 4.2rem;
border-radius: 999px;
line-height: 1;
color: var(--text-secondary);
}
.cite-group .cite-btn:hover {
background: var(--accent);
color: var(--accent-on);
}
.cite-label {
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.04em;
line-height: 1;
color: var(--text-secondary);
padding: 5px 10px;
min-width: 3.5rem;
text-align: center;
}
/* About modal overlay */
.about-overlay {
position: fixed;
inset: 0;
z-index: 100;
background: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
pointer-events: none;
/* Also remove it from the tab order and the accessibility tree while closed.
opacity alone left .about-close, the two arXiv links, .video-close and the
iframe permanently tabbable, and put the modal's h2/h3 headings ahead of
the app's own in the heading outline. `visibility` still animates, so the
fade is preserved. */
visibility: hidden;
/* Delay the flip to hidden until the fade-out finishes, but flip to visible
IMMEDIATELY on open (see .visible). Transitioning visibility symmetrically
keeps the overlay non-visible for the whole 250 ms, and a
visibility:hidden element cannot take focus -- the focus() call on open is
silently rejected. */
transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.about-overlay.visible {
opacity: 1;
pointer-events: all;
visibility: visible;
/* No delay in this direction: focusable as soon as the class lands. */
transition: opacity 0.25s ease, visibility 0s linear 0s;
}
.about-modal {
background: var(--glass-bg);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid var(--border);
border-radius: 16px;
padding: 2rem 2.2rem;
max-width: 560px;
max-height: 80vh;
overflow-y: auto;
position: relative;
box-shadow: 0 20px 60px rgba(0,0,0,0.2);
transform: scale(0.95);
transition: transform 0.25s ease;
}
.about-overlay.visible .about-modal {
transform: scale(1);
}
.about-close {
position: absolute;
top: 0.8rem;
right: 1rem;
background: none;
border: none;
font-size: 1.5rem;
color: var(--text-secondary);
cursor: pointer;
line-height: 1;
}
.about-close:hover {
color: var(--accent);
}
.about-modal h2 {
font-size: 1.3rem;
margin: 0 0 0.8rem;
color: var(--text);
}
.about-modal h3 {
font-size: 1rem;
margin: 1rem 0 0.4rem;
color: var(--text);
font-weight: 600;
}
.about-modal p, .about-modal li {
font-size: 0.95rem;
line-height: 1.6;
color: var(--text-secondary);
margin: 0 0 0.5rem;
}
.about-modal ul {
padding-left: 1.2rem;
margin: 0 0 0.5rem;
}
.about-modal a {
color: var(--accent);
text-decoration: none;
}
.about-modal a:hover {
text-decoration: underline;
}
/* Mobile about modal */
@media (max-width: 900px) {
.about-modal {
max-width: calc(100vw - 2rem);
margin: 1rem;
padding: 1.5rem;
max-height: 85vh;
}
.about-modal h2 { font-size: 1.15rem; }
.about-modal h3 { font-size: 0.92rem; }
.about-modal p, .about-modal li { font-size: 0.88rem; }
}
/* Video modal overlay (reuses about-overlay structure with wider 16:9 modal) */
.video-overlay {
position: fixed;
inset: 0;
z-index: 100;
background: rgba(0, 0, 0, 0.55);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
pointer-events: none;
/* Also remove it from the tab order and the accessibility tree while closed.
opacity alone left .about-close, the two arXiv links, .video-close and the
iframe permanently tabbable, and put the modal's h2/h3 headings ahead of
the app's own in the heading outline. `visibility` still animates, so the
fade is preserved. */
visibility: hidden;
/* Delay the flip to hidden until the fade-out finishes, but flip to visible
IMMEDIATELY on open (see .visible). Transitioning visibility symmetrically
keeps the overlay non-visible for the whole 250 ms, and a
visibility:hidden element cannot take focus -- the focus() call on open is
silently rejected. */
transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.video-overlay.visible {
opacity: 1;
pointer-events: all;
visibility: visible;
/* No delay in this direction: focusable as soon as the class lands. */
transition: opacity 0.25s ease, visibility 0s linear 0s;
}
.video-modal {
background: var(--glass-bg);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid var(--border);
border-radius: 16px;
padding: 0.6rem;
width: min(960px, calc(100vw - 2rem));
max-height: calc(100vh - 2rem);
position: relative;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
transform: scale(0.95);
transition: transform 0.25s ease;
}
.video-overlay.visible .video-modal {
transform: scale(1);
}
/* Close button floats diagonally off the modal's top-right corner */
.video-close {
position: absolute;
top: -1.6rem;
right: -1.6rem;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 999px;
background: transparent;
color: rgba(255, 255, 255, 0.85);
font-size: 1.4rem;
z-index: 1;
transition: color 0.15s, transform 0.15s;
}
.video-close:hover {
color: #fff;
transform: scale(1.1);
}
.video-frame-wrap {
position: relative;
width: 100%;
aspect-ratio: 16 / 9;
border-radius: 10px;
overflow: hidden;
background: #000;
}
.video-frame-wrap iframe {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
border: 0;
}
@media (max-width: 900px) {
.video-modal {
padding: 0.5rem;
width: calc(100vw - 1rem);
border-radius: 12px;
}
.video-close {
top: -2rem;
right: -0.25rem;
}
}
/* Theme toggle */
.theme-toggle {
background: rgba(var(--card-bg-rgb), 0.6);
border: 1px solid var(--border);
border-radius: 999px;
width: 28px;
height: 28px;
padding: 0;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-secondary);
transition: border-color 0.15s, color 0.15s;
}
.theme-toggle svg {
width: 14px;
height: 14px;
display: block;
margin: auto;
}
.theme-toggle:hover {
border-color: var(--accent);
color: var(--accent);
}
.unit-toggle {
background: rgba(var(--card-bg-rgb), 0.6);
border: 1px solid var(--border);
border-radius: 999px;
padding: 4px 10px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-secondary);
font-size: 0.72rem;
font-weight: 600;
transition: border-color 0.15s, transform 0.1s, background 0.15s, color 0.15s;
}
.unit-toggle:hover {
border-color: var(--accent);
color: var(--accent);
}
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
/* Icon shapes are visually off-center in their viewBox; nudge to compensate */
.icon-moon { transform: translate(0.25px, 0px); }
.icon-sun { transform: translate(0px, 0.25px); }
/* Panel hint (instruction text) */
.panel-hint {
font-size: 0.78rem;
color: var(--text-secondary);
margin-bottom: 0.75rem;
line-height: 1.4;
}
h2 {
font-family: "DM Sans", "Inter", sans-serif;
font-size: 1.05rem;
margin-bottom: 0.4rem;
font-weight: 700;
letter-spacing: -0.01em;
line-height: 1.15;
color: var(--text);
}
.layout {
display: grid;
grid-template-columns: 280px 1fr 1fr;
align-items: start;
gap: 0.75rem;
max-width: 1400px;
margin: 0 auto;
}
/* Each column flows independently — panels size to content */
.column-flow {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
/*
* Frosted Glass Panels
*
* Uses backdrop-filter directly on the panel for the blur effect.
*
* Known issue: WebKit has a compositing bug where nested scroll containers
* or canvas elements inside a backdrop-filter parent can cause a subtle
* rendering artifact (visible line) at the border-radius edge. This primarily
* affects resized desktop browsers; actual mobile Safari handles it differently.
*
* Attempted fixes that didn't fully resolve:
* - Pseudo-element decoupling (::before with z-index:-1): eliminates artifact
* but backdrop-filter can't see through the parent's stacking context = no blur
* - WebKit mask hack (-webkit-mask-image: radial-gradient): didn't fix the seam
* - transform:translateZ(0) / will-change / isolation:isolate: no effect
*
* Current approach: accept the artifact (subtle, device-dependent) and keep
* the simplest implementation with full blur support.
*
* Values: 70% opacity (--glass-bg), light=4px / dark=6px blur (--glass-blur)
*/
.panel {
position: relative;
background: var(--glass-bg);
backdrop-filter: blur(var(--glass-blur));
-webkit-backdrop-filter: blur(var(--glass-blur));
border-radius: 12px;
padding: 1rem 1.25rem;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 0 0 1px var(--border);
}
/* Sliders panel
Note: no `max-height` / `overflow-y` here — the panel grows to fit all
ingredient rows naturally on desktop. The references panel in column 3 is
typically taller, so the composition panel still ends within the page flow. */
.sliders {
grid-column: 1;
position: relative;
transition: box-shadow 180ms ease-out;
}
.sliders-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.25rem;
}
.sliders-header h2 { margin: 0; }
.slider-group { margin-bottom: 0.55rem; }
.slider-group label {
display: flex;
/* Vertically align name text with the value-input's text. Without
`align-items: center` the default `stretch` makes the name span and
the value-input fill the row's full height, but the name text sits
at the top of the line box while the value-input's text sits in its
own vertical middle — visually offset. Centering the children's
content axes pins them to the same baseline. */
align-items: center;
justify-content: space-between;
font-size: 0.8rem;
margin-bottom: 2px;
}
.slider-group label span { font-weight: 600; }
/* Per-row unit suffix in the composition setter (e.g. `kg/m³` / `lb/yd³`,
or `°C` for the temperature row). The wrap container packs the value
input and the unit together at the right side of the label, preserving
the row's two-child `space-between` layout (name on the left, value+unit
on the right). The wrap's `padding-right` matches `.info-row { padding: 0 2px }`
so the unit text and the max-bound text share the same right baseline.
Tight `gap` keeps the value+unit reading as a single typographic unit
(e.g. "353.0 kg/m³"), without the chunky empty space a wider gap creates. */
.slider-value-wrap {
display: inline-flex;
align-items: baseline;
gap: 0.15ch;
padding-right: 2px;
}
/* Override `.slider-group label span { font-weight: 600 }` — the unit
should read as a quiet suffix, not as bold as the value. Same
selector specificity (0,2,1) as the bold rule, declared after it so
the cascade order picks this one up.
No fixed-width slot here: the unit hugs its content so the value
doesn't have a gap on its right. The cost is a ~1 character shift of
the value column on metric ↔ imperial toggle (`kg/m³` 5ch vs `lb/yd³`
6ch) — much less noticeable than a permanent empty gap in the
default (metric) view. */
.slider-group label .slider-unit {
font-weight: 400;
font-size: 0.72rem;
opacity: 0.65;
white-space: nowrap;
text-align: right;
}
/* Click-to-edit composition value (regular sliders only — not Material Source).
Visual treatment mirrors `.toggle-btn`: rectilinear with 4px radius and
accent-colored focus border, matching the existing glass-morph language.
Width is 6.5ch to accommodate the worst-case formatted value across both
unit systems — e.g. water 700 kg/m³ in lb/yd³ = `1180.6` (six chars). */
.slider-value {
font: inherit;
font-weight: 600;
text-align: end;
width: 6.5ch;
min-width: 6.5ch;
padding: 2px 4px;
border: 1px solid transparent;
border-radius: 4px;
background: transparent;
color: inherit;
cursor: text;
transition: background 0.15s, border-color 0.15s;
/* Hide native number-input spinners (defensive — input type is `text` here
but `inputmode=decimal` may map to spinner controls in some engines). */
appearance: textfield;
-moz-appearance: textfield;
}
.slider-value::-webkit-inner-spin-button,
.slider-value::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.slider-value:hover {
background: rgba(var(--card-bg-rgb), 0.4);
}
.slider-value:focus {
outline: none;
border-color: var(--accent);
background: rgba(var(--card-bg-rgb), 0.6);
}
/* A border-colour change alone is colour-only signalling; keyboard users get
a real outline. */
.slider-value:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* The input is the TOUCH TARGET; the visible 6 px bar is drawn by the track
pseudo-elements below. Previously the element itself was the 6 px bar, which
meant the whole hit area was 6 px tall -- measured 220x6 on mobile, against a
WCAG 2.2 AA minimum of 24x24 and an Apple HIG recommendation of 44x44. All 8
sliders failed. Separating hit area from visual lets the target grow without
changing anything the user sees. */
.slider-group input[type=range] {
width: 100%;
cursor: pointer;
accent-color: var(--accent);
-webkit-appearance: none;
appearance: none;
height: 24px;
background: transparent;
outline: none;
}
/* `outline: none` above removed the only focus indicator these controls had,
with no replacement anywhere -- a WCAG 2.4.7 Focus Visible (AA) failure on
the app's primary controls. Note Lighthouse's accessibility category does
NOT audit focus visibility, so the a11y score gate cannot catch this. */
.slider-group input[type=range]:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
border-radius: 3px;
}
.slider-group input[type=range]::-webkit-slider-runnable-track {
height: 6px;
background: var(--border);
border-radius: 3px;
}
.slider-group input[type=range]::-moz-range-track {
height: 6px;
background: var(--border);
border-radius: 3px;
}
.slider-group input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--accent);
border: 2px solid rgba(255,255,255,0.9);
cursor: pointer;
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
/* WebKit aligns the thumb to the top of the runnable track, so pull it up
by half the difference to re-center it on the 6 px bar. */
margin-top: -6px;
}
.slider-group input[type=range]::-moz-range-thumb {
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--accent);
border: 2px solid rgba(255,255,255,0.9);
cursor: pointer;
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.slider-group input[type=range]:hover {
opacity: 0.85;
}
/* Slider preview marker (shown on scatter hover) — hollow circle like a ghost thumb */
.slider-group {
position: relative;
/* Half the rendered thumb width, exposed as a CSS variable so the JS
marker-positioning math (`showSliderPreview` in ui.mjs) can derive
the same value via `getComputedStyle(...).getPropertyValue('--thumb-half')`.
Mobile overrides this to 11 px for its larger 22 px touch thumb;
without that override, the preview marker
sat 1 px off-track on mobile. */
--thumb-half: 9px;
}
/* Clickable ingredient names.
Use `text-decoration` instead of `border-bottom` for the dashed
underline so the line sits at the font's natural baseline-offset
(just under the glyphs) rather than below the descender — saves a
few pixels of vertical space per row, especially noticeable on
mobile where every ingredient row is stacked. */
.ingredient-name {
cursor: pointer;
text-decoration: underline dashed var(--text-secondary);
text-decoration-thickness: 1px;
text-underline-offset: 4px;
transition: color 0.15s, text-decoration-color 0.15s;
}
.ingredient-name:hover {
color: var(--accent);
text-decoration-color: var(--accent);
}
.ingredient-name.active {
color: var(--accent);
text-decoration-style: solid;
text-decoration-color: var(--accent);
}
/* Ingredient insight panel */
.ingredient-insight-panel {
padding: 0.75rem 1rem;
}
.ingredient-insight-body {
position: relative;
overflow: hidden;
transition: height 0.3s ease;
}
.ingredient-insight-title {
font-family: "DM Sans", "Inter", sans-serif;
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--accent);
margin-bottom: 0.4rem;
font-weight: 700;
}
.ingredient-insight-text {
font-size: 0.82rem;
line-height: 1.5;
color: var(--text);
transition: opacity 0.3s ease, transform 0.3s ease;
}
.ingredient-insight-text strong {
color: var(--accent);
}
.ingredient-insight-text.fade-out {
opacity: 0;
transform: translateY(6px);
}
.ingredient-insight-text.fade-in {
opacity: 0;
transform: translateY(-6px);
}
.slider-preview-marker {
display: none;
position: absolute;
width: 18px;
height: 18px;
border: 2px solid var(--text);
background: transparent;
border-radius: 50%;
pointer-events: none;
/* Center the circle: offset by half its own size */
transform: translate(-9px, -9px);
opacity: 0.8;
transition: left 0.15s ease-out;
animation: previewPulse 1.5s ease-in-out infinite;
}
.slider-preview-marker.tracking {
transition: none;
}
@keyframes previewPulse {
0%, 100% { opacity: 0.8; transform: translate(-9px, -9px) scale(1); }
50% { opacity: 0.55; transform: translate(-9px, -9px) scale(1.15); }
}
.sliders.previewing {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 0 0 1px var(--accent);
}
.info-row {
display: flex;
justify-content: space-between;
font-size: 0.75rem;
color: var(--text-secondary);
padding: 0 2px;
}
/* Charts */
.chart-panel { position: relative; }
.chart-panel canvas {
width: 100%;
height: 380px;
display: block;
}
/* Extrapolation warning — absolute positioned top-right */
.extrapolation-warning {
position: absolute;
top: 1.05rem;
right: 1.25rem;
font-size: 0.65rem;
font-weight: 500;
color: #92400e;
background: rgba(251, 191, 36, 0.15);
border: 1px solid rgba(251, 191, 36, 0.4);
border-radius: 999px;
padding: 2px 8px;
white-space: nowrap;
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none;
}
.extrapolation-warning.visible {
opacity: 1;
}
[data-theme="dark"] .extrapolation-warning {
color: #fbbf24;
background: rgba(251, 191, 36, 0.1);
border-color: rgba(251, 191, 36, 0.3);
}
/* Readouts */
.readouts {
display: flex;
flex-direction: row;
justify-content: space-around;
gap: 0.5rem;
padding: 0.6rem 0 0;
font-size: 0.82rem;
}
.readouts .value {
font-weight: 700;
color: var(--accent);
}
/* Toggle buttons for Material Source */
.toggle-row {
display: flex;
gap: 4px;
margin-top: 4px;
}
.toggle-btn {
position: relative;
flex: 1;
padding: 4px 8px;
font-size: 0.78rem;
border: 1px solid var(--border);
border-radius: 8px;
background: rgba(var(--card-bg-rgb), 0.6);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
cursor: pointer;
color: var(--text);
transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.toggle-btn.active {
background: var(--accent);
color: var(--accent-on);
border-color: var(--accent);
}
.toggle-btn:hover:not(.active) {
border-color: var(--accent);
transform: translateY(-1px);
}
.toggle-btn[data-previewing]::after {
content: "";
position: absolute;
inset: -3px;
border: 2px solid var(--text);
border-radius: 10px;
pointer-events: none;
opacity: 0.8;
animation: togglePreviewPulse 1.5s ease-in-out infinite;
}
@keyframes togglePreviewPulse {
0%, 100% { opacity: 0.8; transform: scale(1); }
50% { opacity: 0.55; transform: scale(1.06); }
}
/* Controls */
.controls {
display: flex;
gap: 1rem;
align-items: center;
font-size: 0.8rem;
margin-top: 0.5rem;
}
.controls select, .controls button {
font-size: 0.8rem;
padding: 3px 10px;
border-radius: 999px;
border: 1px solid var(--border);
background: rgba(var(--card-bg-rgb), 0.6);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
color: var(--text);
transition: border-color 0.15s;
}
.controls select:hover, .controls button:hover {
border-color: var(--accent);
}
/* Tooltip */
.tooltip {
position: fixed;
background: rgba(30, 41, 59, 0.85);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
color: #fff;
padding: 6px 10px;
border-radius: 6px;
font-size: 0.75rem;
pointer-events: none;
white-space: nowrap;
z-index: 100;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.tooltip::after {
content: "";
position: absolute;
top: 100%;
left: 12px;
border: 5px solid transparent;
border-top-color: rgba(30, 41, 59, 0.85);
}
/* Filter panel */
.filter-label {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-secondary);
}
.filter-row-wrapper {
overflow: hidden;
margin-bottom: 0.3rem;
}
#filter-rows:not(:empty) {
margin-top: 0.4rem;
}
.filter-row-wrapper.collapsed {
display: none;
}
/* Visible to assistive technology only. Standard clip-rect pattern: stays in
the accessibility tree (unlike display:none) while occupying no space. */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.filter-row {
display: flex;
align-items: center;
gap: 0.3rem;
font-size: 0.78rem;
padding: 2px 0;
max-width: 100%;
overflow: hidden;
}
.filter-row select {
flex: 1;
min-width: 0;
max-width: 120px;