-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterview.html
More file actions
529 lines (481 loc) · 45.4 KB
/
Copy pathinterview.html
File metadata and controls
529 lines (481 loc) · 45.4 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>CATalyst — Your CAT Counselling</title>
<meta name="description" content="A 10-minute conversation that figures out your CAT prep and builds you a real plan." />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Sora:wght@600;700;800&display=swap" rel="stylesheet">
<style>
:root{
--bg:#0a0c12;--bg2:#141824;--bg3:#1d2230;--border:rgba(255,255,255,.07);
--text:#eef0f6;--text2:#969cad;--text3:#565c6e;
--accent:#6b8aff;--accent2:#a06bff;--green:#22c79a;--amber:#f5a623;--red:#ff6b6b;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:'Inter',-apple-system,sans-serif;background:radial-gradient(1300px 900px at 50% -15%, #181b30 0%, var(--bg) 55%);color:var(--text);display:flex;flex-direction:column;height:100dvh;max-width:700px;margin:0 auto;overflow:hidden}
.sora{font-family:'Sora','Inter',sans-serif}
/* progress rail */
#prog{height:3px;background:rgba(255,255,255,.05);flex-shrink:0;position:relative;overflow:hidden}
#prog > div{height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent2));border-radius:0 3px 3px 0;transition:width .7s cubic-bezier(.2,.8,.2,1);box-shadow:0 0 12px rgba(107,138,255,.6)}
header{padding:.75rem 1.2rem;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:.65rem;flex-shrink:0}
.logo{width:30px;height:30px;border-radius:9px;background:linear-gradient(135deg,var(--accent),var(--accent2));display:flex;align-items:center;justify-content:center;font-size:1rem;box-shadow:0 4px 14px rgba(107,138,255,.35)}
header h1{font-size:.92rem;font-weight:800;letter-spacing:-.01em}
header .chapter{font-size:.66rem;color:var(--accent);font-weight:600;transition:.3s}
header .right{margin-left:auto}
.icon-btn{background:var(--bg3);border:none;color:var(--text2);border-radius:8px;padding:.38rem .65rem;font-size:.72rem;cursor:pointer;font-family:inherit;font-weight:600}
.icon-btn:hover{color:var(--text)}
/* living profile rail */
#profile{display:none;padding:.5rem 1.2rem;border-bottom:1px solid var(--border);overflow-x:auto;white-space:nowrap;flex-shrink:0;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent)}
#profile::-webkit-scrollbar{display:none}
#profile .plabel{font-size:.6rem;color:var(--text3);font-weight:700;text-transform:uppercase;letter-spacing:.08em;margin-right:.5rem}
.ptag{display:inline-flex;align-items:center;gap:.3rem;background:rgba(107,138,255,.12);border:1px solid rgba(107,138,255,.25);color:#c3cdff;border-radius:99px;padding:.22rem .6rem;font-size:.72rem;font-weight:600;margin-right:.4rem;animation:pop .4s cubic-bezier(.2,1.3,.4,1)}
.ptag::before{content:'';width:5px;height:5px;border-radius:50%;background:var(--accent)}
@keyframes pop{from{opacity:0;transform:scale(.7)}to{opacity:1;transform:none}}
#chat{flex:1;overflow-y:auto;padding:1.3rem;display:flex;flex-direction:column;gap:.55rem}
.msg{max-width:88%;line-height:1.55;animation:rise .45s cubic-bezier(.2,.8,.2,1);word-wrap:break-word}
@keyframes rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.msg.ack{align-self:flex-start;color:var(--text2);font-size:.88rem;padding:.15rem .35rem .05rem;max-width:90%}
.msg.q{align-self:flex-start;background:linear-gradient(135deg,#222845,#191d2e);border:1px solid rgba(107,138,255,.32);border-left:3px solid var(--accent);border-radius:5px 17px 17px 17px;font-weight:600;font-size:1.04rem;color:#fff;box-shadow:0 8px 28px rgba(107,138,255,.14);padding:.78rem 1rem}
.msg.user{align-self:flex-end;background:linear-gradient(135deg,var(--accent),#5a78f0);color:#fff;border-radius:17px 17px 5px 17px;font-weight:500;font-size:.95rem;padding:.7rem .95rem}
.chips{display:flex;flex-wrap:wrap;gap:.45rem;align-self:flex-start;max-width:94%;margin-top:.2rem}
.chip{background:var(--bg3);border:1px solid var(--border);color:var(--text);border-radius:99px;padding:.52rem 1rem;font-size:.85rem;cursor:pointer;font-family:inherit;font-weight:500;transition:.13s;animation:pop .35s backwards}
.chip:hover{border-color:var(--accent);background:rgba(107,138,255,.14);transform:translateY(-1px)}
.chip.skip{color:var(--text3)}
.typing{align-self:flex-start;background:#191d2e;border:1px solid var(--border);border-radius:5px 14px 14px 14px;padding:.85rem 1rem;display:flex;gap:5px}
.typing span{width:7px;height:7px;border-radius:50%;background:var(--accent);opacity:.6;animation:blink 1.2s infinite}
.typing span:nth-child(2){animation-delay:.2s}.typing span:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,60%,100%{opacity:.25}30%{opacity:1}}
.sys-note{align-self:center;font-size:.74rem;color:var(--text3);text-align:center;max-width:80%;padding:.4rem}
footer{padding:.8rem 1rem calc(.8rem + env(safe-area-inset-bottom));border-top:1px solid var(--border);flex-shrink:0}
.composer{display:flex;gap:.5rem;align-items:flex-end}
textarea#answer{flex:1;background:var(--bg2);border:1px solid var(--border);border-radius:14px;color:var(--text);font-family:inherit;font-size:.95rem;padding:.72rem .85rem;resize:none;max-height:120px;line-height:1.4}
textarea#answer:focus{outline:none;border-color:var(--accent)}
#send{background:linear-gradient(135deg,var(--accent),var(--accent2));border:none;color:#fff;border-radius:50%;width:44px;height:44px;font-size:1.15rem;cursor:pointer;flex-shrink:0;box-shadow:0 4px 14px rgba(107,138,255,.4)}
#send:disabled{opacity:.4;cursor:not-allowed;box-shadow:none}
.hint{font-size:.66rem;color:var(--text3);margin-top:.45rem;text-align:center}
/* WELCOME */
.welcome{position:fixed;inset:0;background:radial-gradient(900px 650px at 50% -5%, #1d2138 0%, var(--bg) 62%);z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem;max-width:700px;margin:0 auto}
.welcome .logo{width:64px;height:64px;border-radius:19px;font-size:2rem;margin-bottom:1.4rem;animation:rise .6s ease}
.welcome h2{font-size:1.85rem;font-weight:800;margin-bottom:.85rem;line-height:1.22;letter-spacing:-.025em;animation:rise .6s .1s backwards}
.welcome h2 em{font-style:normal;background:linear-gradient(135deg,var(--accent),var(--accent2));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.welcome p{font-size:1rem;color:var(--text2);line-height:1.65;max-width:440px;margin-bottom:.5rem;animation:rise .6s .2s backwards}
.welcome .priv{font-size:.78rem;color:var(--text3);margin:1.2rem 0 1.8rem;display:flex;align-items:center;gap:.4rem;animation:rise .6s .3s backwards}
.welcome button{background:linear-gradient(135deg,var(--accent),var(--accent2));border:none;color:#fff;border-radius:15px;padding:1rem 2.3rem;font-size:1.05rem;font-weight:700;cursor:pointer;font-family:inherit;box-shadow:0 10px 30px rgba(107,138,255,.42);transition:.18s;animation:rise .6s .35s backwards}
.welcome button:hover{transform:translateY(-2px);box-shadow:0 14px 38px rgba(107,138,255,.5)}
.welcome .meta{font-size:.72rem;color:var(--text3);margin-top:1.15rem;animation:rise .6s .4s backwards}
/* ANTICIPATION overlay */
.analyzing{position:fixed;inset:0;background:rgba(10,12,18,.86);backdrop-filter:blur(10px);z-index:15;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.6rem;max-width:700px;margin:0 auto;animation:fadein .4s}
@keyframes fadein{from{opacity:0}to{opacity:1}}
.orb{width:80px;height:80px;border-radius:50%;background:radial-gradient(circle at 35% 30%, #a06bff, #6b8aff 60%, #3a4ec9);box-shadow:0 0 60px rgba(140,110,255,.55);animation:breathe 2.2s ease-in-out infinite}
@keyframes breathe{0%,100%{transform:scale(1);box-shadow:0 0 50px rgba(140,110,255,.45)}50%{transform:scale(1.12);box-shadow:0 0 80px rgba(140,110,255,.7)}}
.analyzing .txt{font-size:1.02rem;color:var(--text);font-weight:600;text-align:center;min-height:1.4em;transition:.3s}
/* ── REVEALS ── */
.reveal-wrap{align-self:stretch;max-width:100%;animation:rise .55s ease}
.synth{background:linear-gradient(150deg,rgba(107,138,255,.17),rgba(160,107,255,.13));border:1px solid rgba(160,107,255,.32);border-radius:20px;padding:1.5rem 1.3rem;box-shadow:0 16px 50px rgba(90,70,200,.18)}
.synth .eyebrow{font-size:.62rem;font-weight:800;letter-spacing:.16em;text-transform:uppercase;color:var(--accent2);margin-bottom:.8rem;display:flex;align-items:center;gap:.45rem}
.synth .body{font-size:1.06rem;line-height:1.7;color:#fff;font-weight:500}
.stagger{opacity:0;transform:translateY(14px);animation:rise .5s forwards}
.rm-hero{background:linear-gradient(135deg,rgba(107,138,255,.15),rgba(160,107,255,.13));border:1px solid rgba(160,107,255,.3);border-radius:20px;padding:1.4rem;margin-bottom:1rem;text-align:center}
.gauge{position:relative;width:150px;height:150px;margin:0 auto .4rem}
.gauge svg{transform:rotate(-90deg)}
.gauge .ctr{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.gauge .tgt{font-size:1.7rem;font-weight:900;line-height:1;background:linear-gradient(135deg,#fff,#c3cdff);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.gauge .tlbl{font-size:.6rem;color:var(--text2);font-weight:700;text-transform:uppercase;letter-spacing:.08em;margin-top:.2rem}
.rm-from{font-size:.82rem;color:var(--text2);margin-bottom:.5rem}
.rm-from b{color:var(--text)}
.rm-gap{font-size:.92rem;color:var(--text);font-weight:600;background:rgba(0,0,0,.2);border-radius:11px;padding:.6rem;margin:.4rem 0}
.rm-gap b{color:var(--green)}
.rm-enc{font-size:.84rem;color:var(--text2);line-height:1.55}
.rm-traj{display:flex;justify-content:center;gap:.35rem;margin-top:.9rem;flex-wrap:wrap}
.rm-traj .step{background:rgba(0,0,0,.22);border:1px solid var(--border);border-radius:10px;padding:.42rem .65rem;font-size:.7rem;color:var(--text2)}
.rm-traj .step b{display:block;color:#c3cdff;font-size:.84rem;margin-bottom:.1rem}
.rm-traj .sep{color:var(--text3);align-self:center}
.rm-card{background:var(--bg2);border:1px solid var(--border);border-radius:17px;padding:1.1rem 1.2rem;margin-bottom:.85rem}
.rm-card .ttl{font-size:.64rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--accent);margin-bottom:.65rem;display:flex;align-items:center;gap:.45rem}
.rm-prob{font-size:.95rem;line-height:1.6;color:var(--text)}
.phase{display:flex;gap:.7rem;padding:.55rem 0;align-items:flex-start}
.phase:not(:last-child){border-bottom:1px solid rgba(255,255,255,.04)}
.phase .dot{width:23px;height:23px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;font-size:.72rem;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:.05rem}
.phase .body{flex:1}.phase .pn{font-weight:700;font-size:.9rem}.phase .pd{font-size:.78rem;color:var(--text2)}
.phase .pw{font-size:.7rem;color:var(--text3);font-weight:600;white-space:nowrap;margin-top:.15rem}
.day{display:flex;gap:.75rem;padding:.62rem 0;align-items:flex-start}
.day:not(:last-child){border-bottom:1px solid rgba(255,255,255,.04)}
.day .dbadge{width:40px;flex-shrink:0;text-align:center}
.day .dname{font-size:.7rem;font-weight:800;color:var(--text2)}
.day .dbar{height:4px;border-radius:3px;margin-top:.32rem}
.day .dbody{flex:1}
.day .dtop{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap;margin-bottom:.15rem}
.day .dsub{font-size:.88rem;font-weight:700}
.day .dmeta{font-size:.68rem;color:var(--text);background:var(--bg3);border-radius:6px;padding:.1rem .45rem;font-weight:600}
.day .dwhy{font-size:.76rem;color:var(--text2);line-height:1.45}
.s-Quant{color:#6b8aff}.bar-Quant{background:#6b8aff}.s-VARC{color:#a06bff}.bar-VARC{background:#a06bff}
.s-LRDI{color:#22c79a}.bar-LRDI{background:#22c79a}.s-Fix{color:#ff6b6b}.bar-Fix{background:#ff6b6b}
.s-Mock{color:#f5a623}.bar-Mock{background:#f5a623}.s-Rest{color:#565c6e}.bar-Rest{background:#565c6e}
.diff{display:flex;gap:.6rem;align-items:flex-start;padding:.42rem 0;font-size:.86rem;line-height:1.5}
.diff .ic{color:var(--green);flex-shrink:0;font-weight:800}
.rm-cta{background:linear-gradient(135deg,var(--accent),var(--accent2));border-radius:18px;padding:1.2rem;text-align:center;margin-top:.4rem;box-shadow:0 14px 40px rgba(107,138,255,.3)}
.rm-cta h3{font-size:1.05rem;font-weight:800;color:#fff;margin-bottom:.3rem}
.rm-cta p{font-size:.8rem;color:rgba(255,255,255,.88);margin-bottom:.85rem;line-height:1.45}
.rm-cta a button{background:#fff;color:var(--accent);border:none;border-radius:13px;padding:.7rem 1.8rem;font-size:.95rem;font-weight:800;cursor:pointer;font-family:inherit}
.restart-row{text-align:center;margin:1rem 0 .5rem}
/* strategy + accordions + blocks (10/10 roadmap) */
.rm-strategy{background:linear-gradient(135deg,rgba(34,199,154,.13),rgba(107,138,255,.1));border:1px solid rgba(34,199,154,.28);border-radius:15px;padding:.95rem 1.1rem;margin-bottom:.85rem;font-size:.92rem;line-height:1.55;color:var(--text)}
.rm-strategy b{color:var(--green)}
.acc{background:var(--bg2);border:1px solid var(--border);border-radius:13px;margin-bottom:.5rem;overflow:hidden}
.acc summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:.6rem;padding:.8rem .95rem}
.acc summary::-webkit-details-marker{display:none}
.acc .dot{width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent2));color:#fff;font-size:.7rem;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.acc .acc-t{flex:1;font-size:.92rem;font-weight:700}
.acc .acc-when{font-size:.68rem;color:var(--text3);font-weight:600;margin-left:.45rem}
.acc .chev{color:var(--text3);transition:.2s;font-size:1.05rem}
.acc[open] .chev{transform:rotate(90deg)}
.acc-body{padding:0 .95rem .9rem;font-size:.86rem;line-height:1.55}
.acc-body .goal{color:var(--text);margin-bottom:.35rem}
.acc-body .sections{color:var(--text2);margin-bottom:.4rem;font-size:.82rem}
.acc-body .outcome{color:var(--green);font-weight:600;font-size:.8rem}
.day-badge{width:34px;flex-shrink:0;text-align:center}
.day-badge .dn{font-size:.7rem;font-weight:800;color:var(--text2)}
.day-badge .db{height:4px;border-radius:3px;margin-top:.3rem}
.block{display:flex;gap:.6rem;padding:.55rem 0;align-items:flex-start}
.block:not(:last-child){border-bottom:1px solid rgba(255,255,255,.04)}
.bk-ic{font-size:1rem;flex-shrink:0;margin-top:.1rem;width:1.2rem;text-align:center}
.bk-body{flex:1}
.bk-top{display:flex;align-items:baseline;gap:.5rem;justify-content:space-between}
.bk-what{font-size:.87rem;font-weight:600;color:var(--text);flex:1}
.bk-time{font-size:.66rem;color:var(--text2);background:var(--bg3);border-radius:6px;padding:.08rem .4rem;font-weight:700;white-space:nowrap}
.bk-src{display:inline-block;font-size:.66rem;font-weight:700;border-radius:6px;padding:.07rem .45rem;margin:.22rem 0;background:var(--bg3);color:var(--text2)}
.bk-src.cat{background:rgba(107,138,255,.2);color:#c8d2ff;border:1px solid rgba(107,138,255,.35)}
.bk-why{font-size:.75rem;color:var(--text3);line-height:1.4}
.rm-consist{background:rgba(245,166,35,.1);border:1px solid rgba(245,166,35,.26);border-radius:13px;padding:.8rem 1rem;font-size:.85rem;color:#f5cd8a;line-height:1.5;margin-bottom:.85rem}
</style>
</head>
<body>
<!-- WELCOME -->
<div class="welcome" id="welcome">
<div class="logo">⚡</div>
<h2 class="sora">Before CAT plans,<br>let's understand <em>you</em>.</h2>
<p>A 10-minute conversation — not a form. Tell me about your prep honestly, and I'll show you what's really going on, and build you a plan that fits your life.</p>
<div class="priv">🔒 Nothing here is shared — it's only to build your plan.</div>
<button onclick="begin()">Start the conversation →</button>
<div class="meta">Free · ~10 min · no signup</div>
</div>
<!-- ROADMAP TESTER (dev: /interview?test) -->
<div id="rmtest" style="display:none;position:fixed;inset:0;z-index:30;background:var(--bg);padding:1.2rem;overflow:auto;max-width:700px;margin:0 auto">
<h2 class="sora" style="font-size:1.1rem;margin-bottom:.25rem">🧪 Roadmap tester</h2>
<p style="font-size:.8rem;color:var(--text2);margin-bottom:.6rem">Edit the transcript (or paste any profile), then generate just the roadmap. Iterate fast.</p>
<textarea id="rmtest-input" style="width:100%;height:240px;background:var(--bg2);border:1px solid var(--border);border-radius:10px;color:var(--text);font-family:inherit;font-size:.82rem;padding:.7rem;line-height:1.5;resize:vertical"></textarea>
<button onclick="genRoadmapTest()" style="background:linear-gradient(135deg,var(--accent),var(--accent2));border:none;color:#fff;border-radius:11px;padding:.7rem 1.4rem;font-weight:700;cursor:pointer;font-family:inherit;margin-top:.7rem;font-size:.95rem">Generate roadmap →</button>
</div>
<button id="editbtn" onclick="showRoadmapTest()" style="display:none;position:fixed;bottom:1rem;right:1rem;z-index:25;background:var(--bg3);border:1px solid var(--border);color:var(--text);border-radius:99px;padding:.5rem .9rem;font-weight:600;cursor:pointer;font-family:inherit;font-size:.8rem;box-shadow:0 4px 14px rgba(0,0,0,.4)">✎ Edit transcript</button>
<!-- ANALYZING overlay -->
<div class="analyzing" id="analyzing" style="display:none">
<div class="orb"></div>
<div class="txt" id="analyzing-txt">Reading between the lines…</div>
</div>
<div id="prog"><div></div></div>
<header style="display:none" id="header">
<div class="logo">⚡</div>
<div>
<h1 class="sora">CATalyst</h1>
<div class="chapter" id="chapter">Your CAT counselling</div>
</div>
<div class="right"><button class="icon-btn" onclick="restart()">↻</button></div>
</header>
<div id="profile"><span class="plabel">What I'm learning</span></div>
<div id="chat"></div>
<footer id="footer" style="display:none">
<div class="composer">
<textarea id="answer" rows="1" placeholder="Type your answer… or tap an option"></textarea>
<button id="send" onclick="submitText()">↑</button>
</div>
<div class="hint">Be honest — it's just us. Type freely, or tap a quick option.</div>
</footer>
<script>
// ════════════════════════════════════════════════════════════
// PROMPTS
// ════════════════════════════════════════════════════════════
const CHAPTERS=['Your situation','Your days','Where you stand','Your why','What holds you back','Almost there'];
const CONVO_SYSTEM=`You are the CATalyst mentor — a warm, perceptive guide who self-studied for CAT and remembers the loneliness, exhaustion and self-doubt of it. You're having a ~12-minute counselling conversation with a CAT aspirant before building their study plan. Two goals at once: make them feel genuinely UNDERSTOOD (like a real mentor, never a form), AND gather everything needed to build a specific, real plan. It's an interview with an agenda — warm but purposeful.
OUTPUT — respond ONLY with a JSON object, nothing else:
{
"ack": "<a warm, HUMAN reflection of what they just said — a real sentence that shows you GET it. NOT a clipped 2-4 word label. If they expressed emotion (burnout, fear, overwhelm, frustration, self-doubt), gently acknowledge THAT first. null only for your very first message.>",
"q": "<ONE clear, warm question — what they read and answer. One sentence.>",
"options": ["<2-4 quick tappable choices, ONLY when the question has natural options (situation, which section, hours/months range, yes/no). Use [] for open or emotional questions so they type freely.>"],
"invite": false,
"learned": ["<0-3 short tags of NEW facts learned this turn, e.g. 'Dropper','Quant: weak Algebra','VARC freeze','4-5 hrs/day','Self-study'. [] if nothing new.>"],
"chapter": "<one of: 'Your situation' | 'Your days' | 'Where you stand' | 'Your why' | 'What holds you back' | 'Almost there'>",
"done": false
}
Set "invite": true on weak-area, why, obstacle and fear questions — it nudges the UI to encourage them to type freely in their own words. Keep ack and q SHORT — never paragraphs.
VOICE: warm, human, like a senior who has been there. Reflect genuinely before you ask — make them feel heard, not processed. Never judge or rush. Mirror their language: Hinglish if they use it; match a tired or anxious tone with extra gentleness. One thing at a time.
COVERAGE CHECKLIST — you MUST cover EVERY item before finishing. Do NOT set done:true until all are done. If you notice you skipped one, go back and ask it. (Never drop a topic just because you "have enough".)
[ ] SITUATION — student / working / dropper + key detail (re-attempt, placement clash, job hours).
[ ] DAILY REALITY — what a typical day actually looks like; when they're realistically free and their energy then.
[ ] CAPACITY — hours/day AND days/week (ask explicitly) + months until CAT.
[ ] RESOURCES — coached / recorded course / pure self-study? what they're using now (Rodha, PDFs, YouTube, a portal). ALWAYS ASK — never skip this.
[ ] MOCKS — taken any? If yes, get the overall %ile, the sectionals if they remember, AND the STORY (what went wrong/right). If none, note it.
[ ] QUANT (topic level) — which of Arithmetic / Algebra / Geometry / Number System / Modern Math are comfortable vs weak. If they name one, probe the rest.
[ ] VARC (topic level) — RC vs VA. For the weak one probe the real failure (comprehension / inference / author-intent / time / vocabulary).
[ ] LRDI (topic level) — LR vs DI, and which set types trip them.
[ ] THE WHY — the real reason (not the resume answer).
[ ] OBSTACLES — the honest pattern that breaks their consistency.
[ ] FEARS — what failure would feel like; what scares them most.
[ ] SELF-BELIEF — do they believe they can crack it (draw out the FEELING, not a flat yes/no).
DEPTH: probe enough to actually understand. When an answer is vague, follow up once. Stay human, don't interrogate. ~14-18 exchanges is right — depth over speed.
EDGE-CASE ATTUNEMENT (adapt naturally):
- Overwhelmed / burned-out / exhausted → extra gentle, acknowledge the load, smaller framing, reassure it's workable.
- Anxious / freezes in mocks → reassure ("calm and accuracy come before speed"), zero pressure.
- Serial restarter / "I stop after a while" → normalize ("most people hit that wall"), never shame.
- Compares to others → gently reframe to their own race.
- Weak English / Tier-2 / Hinglish → mirror simple language / Hinglish.
- Coached → note it (you'll complement coaching, not duplicate it).
- Very little time / late starter → be honest and encouraging, don't over-promise.
- Dropper with a painful last attempt → hold the weight, ask with care.
NORMALIZE, DON'T EXPOSE: when they admit a weakness or bad pattern, make it feel common ("that's one of the most common things I hear"), never shameful.
OPENING (first message): ack=null, chapter='Your situation'. A warm 1-2 line welcome that sets the contract (~10-12 min, no right answers, skip anything, nothing shared, one line of your own story so they feel safe) + the first question — all in "q". Short and human.
WHEN EVERY CHECKLIST ITEM IS COVERED: {"ack":null,"q":null,"options":[],"invite":false,"learned":[],"chapter":"Almost there","done":true}`;
const PROFILE_PROMPT=`From the conversation below, extract a faithful structured profile of this CAT aspirant. Reply ONLY with JSON:
{
"life_stage":"<student|working|dropper|other>","situation_detail":"","hours_per_day":"","days_per_week":"","months_left":"","busy_windows":"",
"resources":{"mode":"<none|self-study|recorded|coaching>","materials":[]},
"mocks":{"taken":true,"overall":"","quant":"","varc":"","lrdi":"","story":""},
"quant":{"strong":[],"weak":[]},
"varc":{"weak_in":"<RC|VA|both|none>","failure_mode":""},
"lrdi":{"stronger":"<LR|DI|both>","weak_types":""},
"target":"",
"why":"","motivation":"<toward|away>",
"obstacle":"","consistency_pattern":"",
"confidence":"<low|medium|high>",
"flags":[],
"language":"<en|hinglish>"
}
flags can include: time_starved, late_starter, no_baseline, coached, anxious, restarter, weak_english, burnout, high_target. Use "" or [] where unknown. Be faithful — only what they actually said.`;
const SYNTHESIS_PROMPT=`The counselling conversation is below. Write a warm reflection (105–140 words, 4-6 SHORT flowing sentences — NOT one giant run-on sentence) so the aspirant feels deeply SEEN. Name their situation, their anchor and their freeze (in their words), the REAL pattern behind their inconsistency, their WHY, and their fear — honestly, no drama. End with one line on what their plan will assume about their life. Vary sentence length; make it feel human and crafted. Mirror Hinglish if they used it. No headings, no bullets, no "Dear student". Output ONLY the paragraph.`;
const ROADMAP_PROMPT=`You are an expert CAT mentor building a personalized plan for the aspirant in the conversation below. They could be ANYONE — a working pro with 1 hour, a fresher with no baseline, a 97%iler chasing 99.9, an anxious dropper, a coached student, a late starter. ADAPT EVERYTHING to THEIR actual profile. The plan must be the most practical, personal, realistic and positive plan they've ever seen. Reply ONLY with a JSON object in EXACTLY this shape:
{
"diagnosis":"<2-3 lines naming their REAL problem specifically, at their real level>",
"scope":{"current":"<SHORT level descriptor ONLY — e.g. '90%ile' or 'Fresh start'. NOT a sentence.>","target":"<just the number, e.g. 99>","targetUnit":"<e.g. %ile>","gap":"<a COUNTABLE gap from their mock score, e.g. '~+4 correct per section'. If no mock, give the honest realistic jump.>","encouragement":"<one honest hopeful line, never a guarantee>","trajectory":[{"label":"Mock 3","value":"~X"},{"label":"Mock 6","value":"~Y"},{"label":"CAT","value":"<target>"}]},
"strategy":"<ONE punchy line — the overall game plan tailored to them>",
"phases":[{"n":1,"name":"<short>","when":"<e.g. Wk 1-4>","goal":"<what this phase achieves>","sections":"<what EACH section does this phase>","outcome":"<expected %ile movement>"} ... fitted to their MONTHS LEFT],
"week":[{"day":"Mon","theme":"<1-3 word focus>","total":"<~their available hours>","blocks":[
{"kind":"learn|read|practice|fix|mock|rest","subject":"VARC|Quant|LRDI|Fix|Mock|Rest","what":"<concrete action>","time":"<e.g. 45m>","source":"<'CATalyst DPP' / 'CATalyst Fix Mode' / 'CATalyst RC (real CAT passages)' for practice & review; 'YouTube: Rodha — <topic>' / 'Read: an editorial' / 'Your PDF: <topic>' for learning>","why":"<one short line>"}
]} ... ALL 7 days Mon-Sun],
"catalyst":["<3-4 lines on how CATalyst RUNS this exact plan: serves the daily DPPs from these topics, real CAT RC passages, runs Fix Mode review, tracks error patterns, reshuffles next week from mistakes. Specific to THEIR plan.>"],
"consistency":"<ONE warm line: their 'bad day' minimum rule so the chain never breaks>"
}
UNIVERSAL ADAPTIVE RULES — apply the ones that fit THIS person:
1. TIME → scale each day to their hours: 1-2 hrs = 1-2 highest-ROI blocks only; 3-5 hrs = 3-4 blocks; 6+ hrs = 4-5 + heavier practice. Never overload a busy person or underload a free one. Each day's blocks must roughly fill their stated time.
2. MONTHS LEFT → 6+ months = full Foundation→Build→Sharpen→Mock→Peak; 2-3 months = compressed crash mode (only high-frequency topics, earlier/more mocks); <1 month = mocks + revision + Fix only.
3. LEVEL → beginner/low scorer = build concepts, easy→hard laddering; 90%ile+ = SKIP basics, do sharpening + selection strategy + temperament. NEVER give 'foundation basics' to a strong scorer, or advanced drills to a beginner.
4. NO BASELINE (no mocks taken) → make Week 1 Day 1 a short DIAGNOSTIC mini-mock to set their level, then calibrate.
5. FAILURE MODE → diagnose and prescribe: concept gap = learn first; application gap ('get it but fail questions') = drill STARTING questions not theory; speed = timed laddering; anxiety/freeze = untimed first then timed + temperament; silly mistakes = checking discipline.
6. SECTION TIME → pour time into their weak + high-ROI section; maintain strong sections with lighter upkeep. Never split time equally.
7. VARC → if VARC isn't already strong, put DAILY reading (editorials/long-form) + author's-intent technique in EVERY day. It's habit-based; nothing else fixes comprehension.
8. RESOURCES → if COACHED, complement (don't duplicate their DPPs; add Fix Mode, VARC, the gaps coaching misses). If SELF-STUDY, give what to learn AND from where: free resources by topic (Rodha/Bodhee for concepts, editorials for reading, their PDFs) for LEARNING; CATalyst for DPPs/practice/Fix/RC.
9. MOCKS → scale cadence: early 1 per 2 weeks → mid 1/week → final month 2-3/week. Every mock followed by an analysis + Fix block.
10. LIFE → fit their rhythm: job = study windows + heavier weekends; family/health/placement = built-in light weeks. Always 1 rest or light day per week for sustainability.
11. PREREQUISITES & FREQUENCY → sequence topics by dependency; prioritize high-CAT-frequency topics they're weak in first.
12. TONE → low confidence = warmer, smaller wins, reassurance; high confidence/high target = strategic, push harder, less hand-holding. Mirror their language (Hinglish if used).
13. HONESTY → if their target is very hard in their time, say so kindly in the encouragement and give the best realistic path. Never oversell.
14. COVER ALL THREE SECTIONS at TOPIC level — never build the whole plan around one section. Use the specifics they gave: if they're good at Arithmetic but weak in Algebra/Geometry, the Quant blocks target ALGEBRA/GEOMETRY (not "Quant basics"); if LRDI was discussed, schedule the weak set-types (e.g. specific puzzle/DI types). The phases must show the SYLLABUS-COMPLETION PATH — which topics/areas get covered in which phase, so they see how the whole syllabus gets done, not just "study VARC".
FORMAT: every "sections", "goal", "outcome", "what", "why" field MUST be a plain STRING (never an object or array).
The week must touch all three sections across the days (not 4 VARC days). DAY BLOCKS mix learn (what to watch/read) + practice (DPP) + review (Fix) + reading where relevant — filling their hours, never one tiny block. Start the week with their strongest area for momentum. Be specific (name actual topics), warm, realistic, motivating.`;
// ════════════════════════════════════════════════════════════
// LLM via secure proxy
// ════════════════════════════════════════════════════════════
const wait=ms=>new Promise(r=>setTimeout(r,ms));
async function llm(system,msgs,json){
let lastErr=null;
for(let i=0;i<3;i++){
try{
const res=await fetch('/api/interview-chat',{method:'POST',headers:{'Content-Type':'application/json'},
body:JSON.stringify({system,json:!!json,messages:msgs.map(m=>({role:m.role,text:m.text}))})});
if(res.status===503){lastErr=new Error('busy');await wait(900*(i+1));continue;}
if(!res.ok){let d={};try{d=await res.json();}catch(e){}throw new Error(d.error||('server '+res.status));}
const j=await res.json();if(!j.text)throw new Error('empty');return j.text;
}catch(e){lastErr=e;if(String(e.message).indexOf('busy')<0)await wait(600*(i+1));}
}
throw lastErr||new Error('connection');
}
function parseJSON(t){try{return JSON.parse(t);}catch(e){}const m=t.match(/\{[\s\S]*\}/);if(m){try{return JSON.parse(m[0]);}catch(e){}}return null;}
// ════════════════════════════════════════════════════════════
// ENGINE
// ════════════════════════════════════════════════════════════
let history=[],phase='interview',activeChips=null,seenTags={};
const chat=document.getElementById('chat'),answerEl=document.getElementById('answer'),sendBtn=document.getElementById('send');
function el(cls,txt){const d=document.createElement('div');d.className=cls;if(txt!=null)d.textContent=txt;chat.appendChild(d);scroll();return d;}
function scroll(){chat.scrollTop=chat.scrollHeight;}
function showTyping(){const t=document.createElement('div');t.className='typing';t.id='typing';t.innerHTML='<span></span><span></span><span></span>';chat.appendChild(t);scroll();}
function hideTyping(){const t=document.getElementById('typing');if(t)t.remove();}
function setComposer(on){document.getElementById('footer').style.display=on?'block':'none';}
function busy(b){sendBtn.disabled=b;answerEl.disabled=b;}
function clearChips(){if(activeChips){activeChips.remove();activeChips=null;}}
function setProgress(chapter){
const i=CHAPTERS.indexOf(chapter); if(i<0)return;
document.querySelector('#prog>div').style.width=((i+1)/CHAPTERS.length*100)+'%';
document.getElementById('chapter').textContent=chapter;
}
function addTags(tags){
if(!Array.isArray(tags)||!tags.length)return;
const rail=document.getElementById('profile'); rail.style.display='block';
tags.forEach(t=>{ const k=t.toLowerCase().trim(); if(seenTags[k])return; seenTags[k]=1;
const s=document.createElement('span'); s.className='ptag'; s.textContent=t; rail.appendChild(s); });
rail.scrollLeft=rail.scrollWidth;
}
async function nextTurn(){
showTyping();busy(true);
let raw;
try{raw=await llm(CONVO_SYSTEM,history,true);}
catch(e){hideTyping();busy(false);el('sys-note','⚠ Connection hiccup — tap ↑ to retry.');return;}
hideTyping();
const o=parseJSON(raw)||{};
if(o.chapter)setProgress(o.chapter);
if(o.done){history.push({role:'assistant',text:'(complete)'});runReveal();return;}
addTags(o.learned);
if(o.ack)el('msg ack',o.ack);
el('msg q',o.q||raw);
history.push({role:'assistant',text:((o.ack?o.ack+' ':'')+(o.q||''))});
if(Array.isArray(o.options)&&o.options.length){
const wrap=document.createElement('div');wrap.className='chips';
o.options.forEach((opt,i)=>{const c=document.createElement('button');c.className='chip';c.style.animationDelay=(i*60)+'ms';c.textContent=opt;c.onclick=()=>answer(opt);wrap.appendChild(c);});
const sk=document.createElement('button');sk.className='chip skip';sk.textContent='Skip';sk.onclick=()=>answer('(skip)');wrap.appendChild(sk);
chat.appendChild(wrap);activeChips=wrap;scroll();
}
// invite free elaboration (always available, gently encouraged on deep questions)
answerEl.placeholder = o.invite ? 'Type freely — say it however you want…' : 'Type your answer… or tap an option';
busy(false);answerEl.focus();
}
function answer(text){if(phase!=='interview')return;clearChips();el('msg user',text);history.push({role:'user',text});nextTurn();}
function submitText(){const v=answerEl.value.trim();if(!v)return;answerEl.value='';answerEl.style.height='auto';answer(v);}
answerEl.addEventListener('input',()=>{answerEl.style.height='auto';answerEl.style.height=Math.min(answerEl.scrollHeight,120)+'px';});
answerEl.addEventListener('keydown',e=>{if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();submitText();}});
// ── ANTICIPATION + REVEAL ──
const ANALYZE_LINES=['Reading between the lines…','Mapping your strengths…','Finding your real pattern…','Understanding what holds you back…','Building your reflection…'];
let analyzeTimer=null;
function startAnalyzing(){
const ov=document.getElementById('analyzing'),tx=document.getElementById('analyzing-txt');
ov.style.display='flex';let i=0;tx.textContent=ANALYZE_LINES[0];
analyzeTimer=setInterval(()=>{i=(i+1)%ANALYZE_LINES.length;tx.style.opacity=0;setTimeout(()=>{tx.textContent=ANALYZE_LINES[i];tx.style.opacity=1;},250);},1500);
}
function stopAnalyzing(){clearInterval(analyzeTimer);document.getElementById('analyzing').style.display='none';}
async function runReveal(){
phase='done';setComposer(false);clearChips();
document.querySelector('#prog>div').style.width='100%';
startAnalyzing();
let synth=null;try{synth=await llm('You are the CATalyst mentor.',[...history,{role:'user',text:SYNTHESIS_PROMPT}],false);}catch(e){}
await wait(600); stopAnalyzing();
if(synth){
const w=document.createElement('div');w.className='reveal-wrap';
w.innerHTML='<div class="synth"><div class="eyebrow">✦ What I see in you</div><div class="body">'+esc(synth)+'</div></div>';
chat.appendChild(w);scroll();
}
const cta=document.createElement('div');cta.className='reveal-wrap';cta.style.marginTop='.6rem';
const b=document.createElement('button');b.className='chip';b.style.cssText='background:linear-gradient(135deg,var(--accent),var(--accent2));border:none;color:#fff;font-weight:700;padding:.8rem 1.3rem;font-size:.95rem;width:100%';
b.textContent='Now show me my plan →';b.onclick=()=>{cta.remove();runRoadmap();};
cta.appendChild(b);chat.appendChild(cta);scroll();
}
async function runRoadmap(){
startAnalyzing();document.getElementById('analyzing-txt').textContent='Reading your profile…';
// 1) extract a structured profile so the plan is built from DATA, not raw chat
let profile=null;
try{ const p=await llm('You extract structured data faithfully.',[...history,{role:'user',text:PROFILE_PROMPT}],true); profile=parseJSON(p); window._profile=profile; }catch(e){}
document.getElementById('analyzing-txt').textContent='Building your personalised plan…';
const profileText = profile ? ('STRUCTURED PROFILE (your source of truth — build the plan from this):\n'+JSON.stringify(profile)+'\n\n') : '';
let raw=null;try{raw=await llm('You are the CATalyst mentor.',[...history,{role:'user',text:profileText+ROADMAP_PROMPT}],true);}catch(e){}
await wait(450);stopAnalyzing();
const r=parseJSON(raw||'');
if(!r){el('sys-note','⚠ Hiccup building your plan — tap ↻ and try once more.');return;}
renderRoadmap(r);
}
function esc(s){return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');}
function asText(v){ if(v==null)return''; if(typeof v==='string')return v; if(Array.isArray(v))return v.map(asText).join(' · '); if(typeof v==='object')return Object.entries(v).map(([k,val])=>k+': '+asText(val)).join(' · '); return String(v); }
function renderRoadmap(r){
const subj=s=>['Quant','VARC','LRDI','Fix','Mock','Rest'].includes(s)?s:'Quant';
const ICON={learn:'🎧',read:'📖',practice:'✍️',fix:'🔧',mock:'🧪',rest:'☕'};
const sc=r.scope||{};
const R=2*Math.PI*64;
const traj=(sc.trajectory||[]).map((t,i)=>`${i>0?'<span class="sep">→</span>':''}<div class="step"><b>${esc(t.value||'')}</b>${esc(t.label||'')}</div>`).join('');
const phases=(r.phases||[]).map(p=>`<details class="acc"><summary><span class="dot">${esc(String(p.n||''))}</span><span class="acc-t">${esc(p.name||'')}<span class="acc-when">${esc(asText(p.when))}</span></span><span class="chev">›</span></summary><div class="acc-body"><div class="goal">🎯 ${esc(asText(p.goal))}</div>${p.sections?'<div class="sections">'+esc(asText(p.sections))+'</div>':''}${p.outcome?'<div class="outcome">📈 '+esc(asText(p.outcome))+'</div>':''}</div></details>`).join('');
const days=(r.week||[]).map((d,di)=>{
const s=subj(d.subject||(d.blocks&&d.blocks[0]&&d.blocks[0].subject)||'Quant');
const blocks=(d.blocks||[]).map(b=>{
const isCat=/catalyst/i.test(b.source||'');
return `<div class="block"><div class="bk-ic">${ICON[b.kind]||'•'}</div><div class="bk-body"><div class="bk-top"><span class="bk-what">${esc(asText(b.what))}</span>${b.time?'<span class="bk-time">'+esc(asText(b.time))+'</span>':''}</div>${b.source?'<span class="bk-src '+(isCat?'cat':'')+'">'+esc(asText(b.source))+'</span>':''}<div class="bk-why">${esc(asText(b.why))}</div></div></div>`;
}).join('');
return `<details class="acc" ${di===0?'open':''}><summary><div class="day-badge"><div class="dn">${esc(d.day||'')}</div><div class="db bar-${s}"></div></div><span class="acc-t">${esc(d.theme||'')}<span class="acc-when">${esc(d.total||'')}</span></span><span class="chev">›</span></summary><div class="acc-body">${blocks}</div></details>`;
}).join('');
const cat=(r.catalyst||[]).map(x=>`<div class="diff"><span class="ic">✦</span><span>${esc(x)}</span></div>`).join('');
const sections=[
`<div class="rm-hero">
<div class="gauge"><svg width="150" height="150"><circle cx="75" cy="75" r="64" stroke="rgba(255,255,255,.08)" stroke-width="9" fill="none"/><circle cx="75" cy="75" r="64" stroke="url(#g)" stroke-width="9" fill="none" stroke-linecap="round" stroke-dasharray="${R}" stroke-dashoffset="${R*0.16}"/><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#6b8aff"/><stop offset="1" stop-color="#a06bff"/></linearGradient></defs></svg><div class="ctr"><div class="tgt">${esc(sc.target||'')}</div><div class="tlbl">${esc(sc.targetUnit||'target')}</div></div></div>
<div class="rm-from">From <b>${esc(sc.current||'where you are')}</b> — here's the path.</div>
<div class="rm-gap">The gap: <b>${esc(sc.gap||'')}</b></div>
<div class="rm-enc">${esc(sc.encouragement||'')}</div>
${traj?`<div class="rm-traj">${traj}</div>`:''}
</div>`,
`<div class="rm-card"><div class="ttl">🎯 Your real problem</div><div class="rm-prob">${esc(r.diagnosis||r.problem||'')}</div></div>`,
r.strategy?`<div class="rm-strategy">⚡ <b>The game plan:</b> ${esc(r.strategy)}</div>`:'',
`<div class="rm-card"><div class="ttl">🗺 The map · tap any phase</div>${phases}</div>`,
`<div class="rm-card"><div class="ttl">📅 This week · tap a day for your full schedule</div>${days}</div>`,
`<div class="rm-card"><div class="ttl">⚡ How CATalyst runs this plan</div>${cat}</div>`,
r.consistency?`<div class="rm-consist">💪 ${esc(r.consistency)}</div>`:'',
`<div class="rm-cta"><h3 class="sora">CATalyst runs this for you.</h3><p>The daily DPPs, Fix Mode, real CAT questions — all the practice in this plan, adapting to your mistakes every week.</p><a href="https://catalyst-app-six.vercel.app/" target="_blank"><button>Get CATalyst →</button></a></div>
<div class="restart-row"><button class="icon-btn" onclick="restart()">↻ Start over</button></div>`
].filter(Boolean);
const wrap=document.createElement('div');wrap.className='reveal-wrap';chat.appendChild(wrap);
sections.forEach((html,i)=>{ const s=document.createElement('div'); s.className='stagger'; s.style.animationDelay=(i*160)+'ms'; s.innerHTML=html; wrap.appendChild(s); });
scroll();
}
// ── BOOT ──
function begin(){
document.getElementById('welcome').style.display='none';
document.getElementById('header').style.display='flex';
setComposer(true);
history=[{role:'user',text:'Begin the interview now — warm opening (in q) and the first question.',hidden:true}];
nextTurn();
}
function restart(){
history=[];phase='interview';activeChips=null;seenTags={};chat.innerHTML='';
const rail=document.getElementById('profile');rail.innerHTML='<span class="plabel">What I\'m learning</span>';rail.style.display='none';
document.querySelector('#prog>div').style.width='0';
document.getElementById('editbtn').style.display='none';
begin();
}
// ── ROADMAP TESTER (dev) ──
const DEFAULT_TRANSCRIPT=`MENTOR: Are you a college student, working, or a dropper?
ASPIRANT: Dropper, and this is a re-attempt.
MENTOR: What happened last year / what's different this time?
ASPIRANT: I studied on and off the whole year, seriously only for one month. I gave CAT 2025 and got 90.08%ile (Quant 93.83, LRDI 92.87, VARC 69.51). This year I planned to study all year but haven't started yet.
MENTOR: How many hours a day can you dedicate, and what does your day look like?
ASPIRANT: 4-6 hours, anytime — I don't go to college and live alone, so flexible.
MENTOR: Resources / coaching?
ASPIRANT: Pure self-study, using YouTube and PDFs. No mock yet this time.
MENTOR: Anchor and freeze sections?
ASPIRANT: Quant is my anchor. VARC is my freeze — I can comprehend okay but I pick the wrong option, I misread what the author is trying to say. I haven't practiced VARC much.
MENTOR: Your why?
ASPIRANT: I want to earn money and build a business. Middle-class family, no capital, so I have to earn first. I freelance/do development to cover my expenses. CAT/MBA is my launchpad.
MENTOR: What scares you most? Do you believe you can crack it?
ASPIRANT: Financial struggles and family expectations — it's do-or-die, everyone thinks highly of me. Yes, I believe I can get 99%ile if I'm consistent, but I keep stopping after a while. Target: 99%ile.`;
function showRoadmapTest(){
document.getElementById('welcome').style.display='none';
const inp=document.getElementById('rmtest-input'); if(!inp.value.trim()) inp.value=DEFAULT_TRANSCRIPT;
document.getElementById('rmtest').style.display='block';
document.getElementById('editbtn').style.display='none';
}
function genRoadmapTest(){
const t=document.getElementById('rmtest-input').value.trim(); if(!t) return;
document.getElementById('rmtest').style.display='none';
document.getElementById('header').style.display='flex';
document.getElementById('chapter').textContent='Roadmap test';
chat.innerHTML=''; phase='done'; history=[{role:'user',text:t}];
document.getElementById('editbtn').style.display='block';
runRoadmap();
}
if(/test/i.test(location.search+location.hash)) showRoadmapTest();
</script>
</body>
</html>