edgevec 0.9.0

High-performance embedded vector database for Browser, Node, and Edge
Documentation
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
/**
 * EdgeVec Mobile Responsive Styles
 * Touch-optimized layouts and iOS Safari fixes
 * @version 0.6.0
 */

/* =============================================================================
   Base Mobile Resets
   ============================================================================= */

/* Prevent iOS text size adjust */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Smooth scrolling with momentum on iOS */
html,
body {
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
}

/* Prevent pull-to-refresh on Chrome Android */
body {
  overscroll-behavior-y: none;
}

/* Fix for iOS Safari 100vh issue */
.full-height {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height */
}

/* =============================================================================
   Touch Target Optimization
   ============================================================================= */

/* Minimum touch target size: 44x44px (Apple HIG) / 48x48dp (Material) */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  padding: 12px;
}

/* Increase tap area without changing visual size */
.tap-expand::before {
  content: '';
  position: absolute;
  top: -8px;
  right: -8px;
  bottom: -8px;
  left: -8px;
}

/* Disable tap highlight on buttons (we have custom effects) */
button,
a,
input,
select,
textarea,
.btn,
.filter-tag,
.radio,
.result-card {
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

/* Touch-friendly form controls */
input[type="text"],
input[type="number"],
input[type="range"],
select,
textarea {
  font-size: 16px; /* Prevents iOS zoom on focus */
  touch-action: manipulation;
}

/* =============================================================================
   Mobile Breakpoint: 768px
   ============================================================================= */

@media screen and (max-width: 768px) {
  /* Typography scaling */
  :root {
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
  }

  /* Header mobile */
  .header {
    padding: var(--space-sm) var(--space-md);
  }

  .header__inner {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .header__logo {
    flex: 1;
  }

  .header__nav {
    display: none; /* Hide nav on mobile, could add hamburger menu */
  }

  .header__actions {
    gap: var(--space-sm);
  }

  /* Hero section */
  .hero {
    padding: var(--space-xl) var(--space-md);
  }

  .hero__title {
    font-size: var(--font-size-2xl);
    word-break: break-word;
  }

  .hero__subtitle {
    font-size: var(--font-size-sm);
  }

  /* Status bar stacking */
  .status-bar {
    flex-direction: column;
    gap: var(--space-xs);
    align-items: stretch;
  }

  .status-bar__item {
    justify-content: space-between;
    padding: var(--space-xs) var(--space-sm);
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .status-bar__item:last-child {
    border-bottom: none;
  }

  /* Layout: single column on mobile */
  .layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .sidebar {
    order: 2; /* Move controls below results on mobile */
  }

  .content {
    order: 1;
  }

  /* Terminal (control panel) */
  .terminal {
    max-height: none;
  }

  .terminal__body {
    padding: var(--space-md);
  }

  /* Control groups */
  .control-group {
    margin-bottom: var(--space-md);
  }

  /* Filter tags */
  .filter-tags {
    flex-wrap: wrap;
  }

  .filter-tag {
    flex: 0 0 auto;
    padding: var(--space-xs) var(--space-sm);
  }

  /* Search box */
  .search-box__input {
    font-size: 16px;
    padding: var(--space-md);
  }

  .search-box__btn {
    width: 48px;
    height: 48px;
  }

  /* Results grid */
  .results {
    gap: var(--space-md);
  }

  /* Grid layouts */
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  /* Metric cards */
  .metric-card {
    padding: var(--space-md);
  }

  .metric-card__value {
    font-size: var(--font-size-xl);
  }

  /* Memory stats */
  .memory-stats {
    flex-direction: column;
    gap: var(--space-md);
  }

  .memory-stats__item {
    flex-direction: row;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
  }

  .memory-stats__item:last-child {
    border-bottom: none;
  }

  /* Footer */
  .footer {
    padding: var(--space-lg) var(--space-md);
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  /* Sections */
  .section {
    padding: var(--space-xl) var(--space-md);
  }

  .section__title {
    font-size: var(--font-size-xl);
  }
}

/* =============================================================================
   Small Mobile Breakpoint: 480px
   ============================================================================= */

@media screen and (max-width: 480px) {
  /* Even smaller typography */
  :root {
    --font-size-base: 13px;
    --font-size-lg: 15px;
    --font-size-xl: 18px;
    --font-size-2xl: 22px;
  }

  /* Tighter spacing */
  .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  /* Header logo */
  .header__logo .glitch {
    font-size: 18px;
  }

  .header__version {
    font-size: 10px;
  }

  /* Hero */
  .hero {
    padding: var(--space-lg) var(--space-sm);
  }

  .hero__title {
    font-size: 20px;
    letter-spacing: 0.05em;
  }

  /* Buttons */
  .btn {
    width: 100%;
    justify-content: center;
    padding: var(--space-md);
  }

  .btn--small {
    width: auto;
    padding: var(--space-xs) var(--space-sm);
  }

  /* Radio group vertical layout */
  .radio-group {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .radio {
    padding: var(--space-sm);
  }

  /* Result cards */
  .result-card {
    padding: var(--space-sm);
  }

  .result-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  /* Memory gauge */
  .memory-gauge {
    max-width: 200px;
    margin: 0 auto;
  }

  /* Filter tags scroll */
  .filter-tags {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-xs);
    -webkit-overflow-scrolling: touch;
  }

  .filter-tags::-webkit-scrollbar {
    height: 4px;
  }

  .filter-tags::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 2px;
  }
}

/* =============================================================================
   Bottom Sheet Pattern (for mobile controls)
   ============================================================================= */

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-color);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: var(--z-modal);
  max-height: 80vh;
  max-height: 80dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet--open {
  transform: translateY(0);
}

.bottom-sheet__handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: var(--space-sm) auto var(--space-md);
}

.bottom-sheet__content {
  padding: 0 var(--space-md) var(--space-lg);
}

/* Bottom sheet backdrop */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: calc(var(--z-modal) - 1);
}

.bottom-sheet-backdrop--visible {
  opacity: 1;
  visibility: visible;
}

/* =============================================================================
   iOS Safari Specific Fixes
   ============================================================================= */

/* Fix position:fixed with virtual keyboard */
@supports (-webkit-touch-callout: none) {
  .header {
    position: sticky;
    top: 0;
  }

  /* Fix for Safari flexbox gap bug */
  .status-bar {
    gap: 0;
  }

  .status-bar__item + .status-bar__item {
    margin-left: var(--space-md);
  }

  @media screen and (max-width: 768px) {
    .status-bar__item + .status-bar__item {
      margin-left: 0;
      margin-top: var(--space-xs);
    }
  }
}

/* Safe area insets for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer {
    padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
  }

  .bottom-sheet {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .toast-container {
    bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  }
}

/* =============================================================================
   Landscape Orientation
   ============================================================================= */

@media screen and (max-height: 500px) and (orientation: landscape) {
  /* Reduce vertical spacing in landscape */
  .hero {
    padding: var(--space-md);
  }

  .hero__title {
    font-size: var(--font-size-xl);
  }

  .section {
    padding: var(--space-lg) var(--space-md);
  }

  /* Side-by-side layout in landscape */
  .layout {
    grid-template-columns: 300px 1fr;
  }

  .sidebar {
    order: 1;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
  }

  .content {
    order: 2;
  }

  /* Memory gauge smaller */
  .memory-gauge {
    max-width: 150px;
  }
}

/* =============================================================================
   Touch-specific Interactions
   ============================================================================= */

/* Active states for touch */
@media (hover: none) and (pointer: coarse) {
  .btn:active,
  .filter-tag:active,
  .result-card:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  /* Remove hover effects that don't work on touch */
  .btn:hover,
  .filter-tag:hover,
  .result-card:hover {
    transform: none;
    box-shadow: inherit;
  }

  /* Ensure focus states work */
  .btn:focus-visible,
  .filter-tag:focus-visible,
  .result-card:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
  }
}

/* =============================================================================
   Reduced Data Mode
   ============================================================================= */

@media (prefers-reduced-data: reduce) {
  /* Disable background effects */
  .noise-overlay,
  .scanline-overlay {
    display: none;
  }

  /* Disable web fonts (use system fonts) */
  :root {
    --font-display: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Consolas, monospace;
  }
}

/* =============================================================================
   Print Styles (for completeness)
   ============================================================================= */

@media print {
  /* Hide interactive elements */
  .header__nav,
  .header__actions,
  .theme-toggle,
  .btn,
  .bottom-sheet,
  .toast-container,
  .noise-overlay,
  .scanline-overlay {
    display: none !important;
  }

  /* Reset colors for print */
  * {
    color: black !important;
    background: white !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Show links */
  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
  }
}

/* =============================================================================
   Dark Mode Forced Colors (High Contrast)
   ============================================================================= */

@media (forced-colors: active) {
  .btn,
  .filter-tag,
  .result-card,
  .terminal {
    border: 2px solid CanvasText;
  }

  .neon-text,
  .glitch {
    color: CanvasText;
    text-shadow: none;
  }

  .gauge__progress {
    stroke: Highlight;
  }
}