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 
 
 
 
 
 
 
 
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
/* ============================================================
   MOODLINE — design tokens
   ============================================================ */

:root{
  --bg: #0e0f14;
  --surface: #16171f;
  --surface-2: #1c1e29;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text: #f2f0ea;
  --text-dim: #9497a6;
  --text-faint: #5c5f6d;

  /* neutral accent while idle / no result yet */
  --accent: #6c7a89;
  --accent-soft: rgba(108,122,137,0.18);

  --font-display: "Fraunces", serif;
  --font-body: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-soft: cubic-bezier(.4,0,.2,1);
}

/* per-emotion accent palette, applied to <body data-emotion="..."> */
body[data-emotion="sadness"]  { --accent: #5b7fde; --accent-soft: rgba(91,127,222,0.16); }
body[data-emotion="joy"]      { --accent: #f2b705; --accent-soft: rgba(242,183,5,0.16); }
body[data-emotion="love"]     { --accent: #e85d75; --accent-soft: rgba(232,93,117,0.16); }
body[data-emotion="anger"]    { --accent: #e4572e; --accent-soft: rgba(228,87,46,0.16); }
body[data-emotion="fear"]     { --accent: #8b5fbf; --accent-soft: rgba(139,95,191,0.16); }
body[data-emotion="surprise"] { --accent: #17bebb; --accent-soft: rgba(23,190,187,0.16); }

/* fixed colors for breakdown bars, independent of current accent */
.bar-sadness  .bar-fill{ background: #5b7fde; }
.bar-joy      .bar-fill{ background: #f2b705; }
.bar-love     .bar-fill{ background: #e85d75; }
.bar-anger    .bar-fill{ background: #e4572e; }
.bar-fear     .bar-fill{ background: #8b5fbf; }
.bar-surprise .bar-fill{ background: #17bebb; }

/* ============================================================
   RESET / BASE
   ============================================================ */

*{ box-sizing: border-box; }
html{ color-scheme: dark; }

body{
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60% 50% at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  transition: background 900ms var(--ease-soft);
  overflow-x: hidden;
}

textarea, button{ font-family: inherit; }

/* subtle film-grain overlay for warmth, purely decorative */
.grain{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Focus-visible improvements */
:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.app{
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
  animation: rise 700ms var(--ease-out) both;
}

.brand{ display: flex; align-items: center; gap: 10px; }
.brand-mark{
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 3px transparent;
  transition: background 400ms, box-shadow 400ms;
}
.brand-mark.live{ background: #52d17c; box-shadow: 0 0 0 3px rgba(82,209,124,0.18); }
.brand-mark.warming{ background: #f2b705; box-shadow: 0 0 0 3px rgba(242,183,5,0.18); animation: pulse-dot 1.4s ease-in-out infinite; }
.brand-mark.down{ background: #e4572e; box-shadow: 0 0 0 3px rgba(228,87,46,0.18); }

@keyframes pulse-dot{ 50%{ opacity: 0.35; } }

.brand-name{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand-tag{
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.eyebrow{
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 14px;
}

main{ flex: 1; }

/* ============================================================
   CONSOLE (input area + orb)
   ============================================================ */

.console{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  animation: rise 800ms 80ms var(--ease-out) both;
}

@media (max-width: 720px){
  .console{ grid-template-columns: 1fr; padding: 28px; gap: 28px; }
}

/* --- the orb: signature element -------------------------------- */

.orb-stage{
  position: relative;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-glow{
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 72%);
  filter: blur(26px);
  opacity: 0.55;
  transition: background 700ms var(--ease-soft);
  animation: breathe 6s ease-in-out infinite;
}

.orb{
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #0e0f14));
  border-radius: 42% 58% 65% 35% / 48% 42% 58% 52%;
  box-shadow: inset 0 0 30px rgba(255,255,255,0.14), 0 20px 40px -18px var(--accent);
  animation: morph 9s ease-in-out infinite, breathe 6s ease-in-out infinite;
  transition: background 700ms var(--ease-soft), box-shadow 700ms var(--ease-soft);
}

.orb.thinking{
  animation: morph 2.1s ease-in-out infinite, spin 2.1s linear infinite, pulse-glow 2s ease-in-out infinite;
}

.orb.settled{
  animation: morph 9s ease-in-out infinite, settle-pop 640ms var(--ease-out);
}

/* Subtle glow pulse during thinking */
@keyframes pulse-glow{
  0%, 100%{ box-shadow: inset 0 0 30px rgba(255,255,255,0.14), 0 20px 40px -18px var(--accent); }
  50%{ box-shadow: inset 0 0 40px rgba(255,255,255,0.22), 0 25px 50px -12px var(--accent); }
}

.orb.settled{
  animation: morph 9s ease-in-out infinite, settle-pop 640ms var(--ease-out);
}

.orb-emoji{
  font-size: 38px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
  transition: opacity 200ms;
  font-family: var(--font-body);
  color: rgba(255,255,255,0.92);
}

@keyframes breathe{
  0%, 100%{ transform: scale(1); }
  50%{ transform: scale(1.05); }
}

@keyframes morph{
  0%,100%{ border-radius: 42% 58% 65% 35% / 48% 42% 58% 52%; }
  33%{     border-radius: 60% 40% 44% 56% / 40% 62% 38% 60%; }
  66%{     border-radius: 48% 52% 38% 62% / 62% 40% 60% 38%; }
}

@keyframes spin{
  to{ transform: rotate(360deg); }
}

@keyframes settle-pop{
  0%{ transform: scale(0.86); }
  55%{ transform: scale(1.08); }
  100%{ transform: scale(1); }
}

/* --- input panel -------------------------------------------------- */

.input-panel{ min-width: 0; }

textarea{
  width: 100%;
  min-height: 118px;
  resize: vertical;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  outline: none;
  transition: border-color 250ms, box-shadow 250ms;
}
textarea::placeholder{ color: var(--text-faint); }
textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.input-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.char-count{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.btn-primary{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  background: var(--text);
  color: #0e0f14;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), background 300ms var(--ease-soft), opacity 200ms var(--ease-soft);
  user-select: none;
}
.btn-primary:hover:not(:disabled){
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn-primary:active:not(:disabled){ transform: translateY(0); }
.btn-primary:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary:disabled{ opacity: 0.35; cursor: not-allowed; }

.btn-arrow{ transition: transform 220ms var(--ease-out); }
.btn-primary:hover:not(:disabled) .btn-arrow{ transform: translateX(3px); }

.btn-primary.loading .btn-label::after{
  content: "";
}
.btn-primary.loading{ pointer-events: none; }

/* Reduced motion: disable subtle animations */
@media (prefers-reduced-motion: reduce){
  .btn-primary:hover:not(:disabled){ transform: none; box-shadow: none; background: var(--accent); }
  .orb{ animation: none !important; }
  .bar-fill{ transition-duration: 0.01ms !important; }
}

.error-msg{
  margin: 12px 2px 0;
  font-size: 13px;
  color: #ff8a72;
  font-family: var(--font-mono);
}

.error-msg.visible{
  animation: shake 0.4s ease-in-out;
}

@keyframes shake{
  0%, 100%{ transform: translateX(0); }
  20%{ transform: translateX(-8px); }
  40%{ transform: translateX(8px); }
  60%{ transform: translateX(-6px); }
  80%{ transform: translateX(6px); }
}

/* ============================================================
   RESULT
   ============================================================ */

.result{
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 720px){
  .result{ grid-template-columns: 1fr; }
}

.result.entering{ animation: rise 620ms var(--ease-out) both; }

.reveal, .breakdown{
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.reveal-main{
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.reveal-emoji{
  font-size: 40px;
  line-height: 1;
}

#emotionWord{
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(36px, 6vw, 52px);
  letter-spacing: -0.01em;
  color: var(--accent);
  transition: color 500ms var(--ease-soft);
}

.confidence-mono{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.echoed-text{
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
  font-style: italic;
}

.bars{
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.bar-row{
  display: grid;
  grid-template-columns: 84px 1fr 52px;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  animation: bar-enter 0.5s var(--ease-out) forwards;
}

@keyframes bar-enter{
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger bars - earlier bars animate sooner */
.bar-row:nth-child(1){ animation-delay: 0ms; }
.bar-row:nth-child(2){ animation-delay: 70ms; }
.bar-row:nth-child(3){ animation-delay: 140ms; }
.bar-row:nth-child(4){ animation-delay: 210ms; }
.bar-row:nth-child(5){ animation-delay: 280ms; }
.bar-row:nth-child(6){ animation-delay: 350ms; }

.bar-label{
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: capitalize;
  transition: color 200ms var(--ease-soft);
}

.bar-label:hover{
  color: var(--accent);
}

.bar-track{
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.bar-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent-soft);
  transition: width 900ms var(--ease-out), background 400ms var(--ease-soft);
}

.bar-fill.bar-joy{ background: #f2b705; }
.bar-fill.bar-love{ background: #e85d75; }
.bar-fill.bar-anger{ background: #e4572e; }
.bar-fill.bar-fear{ background: #8b5fbf; }
.bar-fill.bar-surprise{ background: #17bebb; }
.bar-fill.bar-sadness{ background: #5b7fde; }

.bar-pct{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
  transition: color 200ms var(--ease-soft);
}

.bar-pct:hover{
  color: var(--text);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footbar{
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

@keyframes rise{
  from{ opacity: 0; transform: translateY(14px); }
  to{ opacity: 1; transform: translateY(0); }
}