/* Chapter 2 — investigator's desktop */
body.ch2 { background-color: var(--paper); background-image: radial-gradient(rgba(0,120,191,.28) 1.4px, transparent 1.7px); background-size: 14px 14px; }
.ch2 .top { background: var(--ink); color: var(--sheet); max-width: none; padding-inline: max(var(--gutter), calc((100vw - 1440px) / 2 + var(--gutter))); }
.ch2 .top a { color: var(--sheet); } .ch2 .top a:hover { color: var(--yel); }
.ch2 .top .lang { border-color: var(--sheet); } .ch2 .top .lang button { color: var(--sheet); }
.ch2 .top .lang button[aria-pressed="true"] { background: var(--yel); color: var(--ink); }
.ch2 h1 { font-size: clamp(36px, 5vw, 72px); letter-spacing: -.03em; margin-top: 20px; }
.ch2 .lede { margin-top: 16px; }
.ch2 .intro-wrap { padding-top: 36px; }

.desk { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-block: 36px 24px; }
.files { list-style: none; flex: 0 0 104px; display: flex; flex-direction: column; gap: 14px; }
.files button { width: 104px; min-height: 84px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; line-height: 1.35; text-align: center; padding: 4px; border-radius: 8px; }
.files .ico { width: 62px; height: 46px; border-radius: 6px 6px 8px 8px; background: var(--sheet); box-shadow: inset 0 0 0 3px var(--ink); position: relative; }
.files .ico::before { content: ""; position: absolute; left: 0; top: -7px; width: 26px; height: 10px; border-radius: 5px 5px 0 0; background: var(--ink); }
.files button[aria-pressed="true"] .ico { background: var(--yel); }
.files button[aria-pressed="true"] { background: rgba(255,255,255,.6); }
.files button.seen .ico::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 22px var(--pop); color: var(--blue); }
.wins { flex: 1 1 760px; min-width: 0; display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.win { min-width: 0; border: 4px solid var(--ink); border-radius: 14px; background: var(--sheet); overflow: hidden; position: relative; }
.win > h3 { font-family: var(--body); font-weight: 700; font-size: 16px; line-height: 1.4; padding: 10px 16px; background: var(--ink); color: var(--yel); display: flex; justify-content: space-between; gap: 12px; }
.win > h3 .dots { letter-spacing: 4px; opacity: .7; }
.win .pad { padding: 18px; }
.w-video { flex: 1 1 520px; box-shadow: 10px 10px 0 var(--pink); transform: rotate(-.6deg); }
.w-steps { flex: 1 1 360px; box-shadow: 8px 8px 0 var(--blue); transform: rotate(.8deg); }
.w-clue { flex: 1 1 320px; box-shadow: 8px 8px 0 var(--yel), 8px 8px 0 4px var(--ink); transform: rotate(.6deg); }
.w-next { flex: 2 1 480px; box-shadow: 8px 8px 0 var(--pink); transform: rotate(-.4deg); background: var(--yel); }
.w-next > h3 { background: var(--ink); }
@media (min-width: 1000px) and (pointer: fine) { .win > h3 { cursor: grab; touch-action: none; } .win.drag > h3 { cursor: grabbing; } .win.drag { z-index: 5; transition: none; } }
.stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background-color: var(--tint-pink); }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .claim { position: absolute; left: 14px; top: 14px; right: 14px; }
.stage .claim span { display: inline; padding: 6px 12px; background: var(--sheet); font-family: var(--display); font-weight: 900; font-size: clamp(16px, 2vw, 22px); line-height: 1.9; box-shadow: 4px 4px 0 var(--red); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.w-video .cap { padding: 10px 16px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.w-video .cap .track { flex: 1; height: 8px; border-radius: 4px; background: rgba(30,42,110,.2); overflow: hidden; }
.w-video .cap .track i { display: block; width: 38%; height: 100%; background: var(--red); }
.steps { list-style: none; counter-reset: st; }
.steps details { border-bottom: 2px dashed rgba(30,42,110,.3); counter-increment: st; }
.steps li:last-child details { border-bottom: 0; }
.steps summary { min-height: 48px; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; cursor: pointer; list-style: none; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary::before { content: counter(st); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--yel); display: grid; place-items: center; font: 800 15px var(--pop); }
.steps summary::after { content: "+"; margin-left: auto; font: 800 22px var(--pop); }
.steps details[open] summary::after { content: "–"; }
.steps details p { padding: 0 0 14px 42px; font-size: 16px; }
.w-clue p { font-size: 16px; }
.w-next .opts { display: grid; gap: 10px; }
.w-next .opts button { min-height: 50px; text-align: left; padding: 8px 20px; border-radius: 999px; border: 3px solid var(--ink); background: var(--sheet); font-weight: 900; font-size: 17px; line-height: 1.4; }
.w-next .opts button[aria-pressed="true"] { background: var(--ink); color: var(--yel); }
.w-next .fb { margin-top: 14px; font-size: 17px; min-height: 3.4em; }
.w-next .fb strong { color: var(--red-text); } .w-next .fb.best strong { color: var(--blue); }
.w-next .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
@media (max-width: 720px) {
  .files { flex: 1 1 100%; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .files button { flex: none; width: 84px; }
}

.notes { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; }
.notes li { padding: 22px; background: var(--tint-yel); border: 4px solid var(--ink); font-size: 16px; }
.notes li:nth-child(odd) { transform: rotate(-1deg); background: var(--tint-pink); }
.notes li:nth-child(even) { transform: rotate(.8deg); }
.notes b { display: block; font-family: var(--display); font-weight: 900; font-size: 19px; line-height: 1.4; margin-bottom: 10px; }
.notes small { display: block; font: 800 12px var(--pop); letter-spacing: .08em; margin-bottom: 4px; }
.ch2 .section > h2 { background: var(--paper); display: inline-block; padding: 0 8px; margin-left: -8px; }

/* v2: group-chat stories */
.guess { margin-top: 18px; }
.guess .row { display: flex; flex-wrap: wrap; gap: 12px; }
.reveal { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding: 22px; background: var(--sheet); border: 4px solid var(--ink); border-radius: 8px; transform: rotate(-.4deg); }
.reveal[hidden] { display: none; }
.reveal .lede { flex: 1 1 320px; }
.coin { flex: none; width: 92px; height: 92px; perspective: 400px; }
.coin i { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--yel); border: 5px solid var(--ink); font: 800 30px var(--pop); font-style: normal; animation: coin 1.1s cubic-bezier(.3,.6,.3,1); }
.coin i::after { content: "?"; }
@keyframes coin { from { transform: translateY(-60px) rotateX(1440deg) } to { transform: none } }
.wins { flex-wrap: wrap; }
.w-chat { flex: 1 1 440px; max-width: 620px; box-shadow: 10px 10px 0 var(--pink); background: #EDEDE6; transform: rotate(-.4deg); }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.side .w-steps { flex: none; }
.desk-note { background: var(--paper); padding: 10px 12px; border-radius: 6px; }
.chat { padding: 16px 14px 6px; display: flex; flex-direction: column; gap: 10px; min-height: 300px; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 88%; animation: pop .28s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes pop { from { transform: translateY(10px) scale(.94); opacity: 0 } to { transform: none; opacity: 1 } }
.msg .av { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 15px; color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
.msg .who { font-size: 12px; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.msg .bub { padding: 9px 13px; border-radius: 4px 14px 14px 14px; background: #fff; border: 2.5px solid var(--ink); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bub { background: var(--yel); border-radius: 14px 4px 14px 14px; }
.msg.me .who { text-align: right; }
.msg.sys { align-self: center; max-width: 100%; }
.msg.sys .bub { background: none; border: 0; font-size: 13px; font-weight: 700; opacity: .7; padding: 2px 8px; text-align: center; }
.clip { display: block; width: min(250px, 60vw); border: 2.5px solid var(--ink); border-radius: 4px 14px 14px 14px; overflow: hidden; background: #fff; }
.clip svg { display: block; width: 100%; }
.clip span { display: block; padding: 7px 10px; font-weight: 700; font-size: 14px; line-height: 1.4; border-top: 2.5px solid var(--ink); }
.voice { display: flex; align-items: center; gap: 4px; min-width: 150px; }
.voice i { width: 4px; border-radius: 2px; background: var(--ink); }
.voice b { margin-left: 8px; font: 800 13px var(--pop); }
.reply { padding: 12px 14px 16px; border-top: 3px solid var(--ink); background: var(--sheet); display: grid; gap: 10px; }
.reply .q { font-family: var(--display); font-weight: 900; font-size: 18px; }
.reply button.opt { min-height: 48px; text-align: left; padding: 8px 16px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; font-weight: 700; font-size: 16px; line-height: 1.45; }
.reply button.opt:hover { background: var(--tint-yel); }
.lesson { padding: 16px; background: var(--ink); color: var(--sheet); border-radius: 10px; font-size: 16px; }
.lesson b { display: block; font-family: var(--display); font-weight: 900; font-size: 19px; color: var(--yel); margin-bottom: 6px; }
.lesson .src { color: var(--yel); }
.reply .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.steps li.hl summary { background: var(--yel); box-shadow: -8px 0 0 var(--yel), 8px 0 0 var(--yel); }
@media (max-width: 720px) { .w-chat { max-width: none; } }
.files button b { font: 800 13px var(--pop); }
.bridge { margin-top: 18px; padding: 16px 20px; background: var(--sheet); border-left: 8px solid var(--pink); }
.bridge b { background: var(--yel); padding: 0 4px; }
.pause { position: relative; overflow: hidden; padding: 8px 14px; border-radius: 10px; background: rgba(30,42,110,.1); font-weight: 700; font-size: 15px; }
.pause i { position: absolute; inset: 0; background: var(--yel); transform-origin: left; animation: pausebar 3.2s linear forwards; }
.pause span { position: relative; }
@keyframes pausebar { from { transform: scaleX(0) } to { transform: scaleX(1) } }
.reply button.opt:disabled { opacity: .45; cursor: wait; }
.voicebtn { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; background: #fff; }
.voicebtn > svg { width: 22px; height: 22px; flex: none; fill: var(--ink); }
.voicebtn.playing { background: var(--yel); }
.voicebtn.playing .voice i { animation: vbar .5s ease-in-out infinite alternate; }
.voicebtn.playing .voice i:nth-child(2n) { animation-duration: .36s; } .voicebtn.playing .voice i:nth-child(3n) { animation-duration: .62s; }
@keyframes vbar { from { transform: scaleY(.35) } to { transform: scaleY(1) } }
.synth { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--red-text); }

/* playable clips */
button.clip { padding: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; position: relative; }
button.clip:hover { box-shadow: 4px 4px 0 var(--yel); }
.clip .prog { display: block; height: 6px; background: rgba(30,42,110,.15); }
.clip .prog::after { content: ""; display: block; height: 100%; width: 0; background: var(--red); }
.clip.playing .prog::after, .voicebtn.playing::after { animation: prog var(--d, 4s) linear forwards; }
@keyframes prog { from { width: 0 } to { width: 100% } }
.clip .pi { transition: opacity .15s; }
.clip.playing .pi { opacity: 0; }
.clip .mouth, .clip .dz { transform-box: fill-box; transform-origin: center; }
.clip.playing .mouth { animation: talk .19s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(.5) } to { transform: scaleY(2.6) } }
.clip .dz { transform-origin: center bottom; }
.clip.playing .dz { animation: dz .38s ease-in-out infinite alternate; }
@keyframes dz { from { transform: rotate(-11deg) translateY(0) } to { transform: rotate(11deg) translateY(-6px) } }
.voicebtn { position: relative; overflow: hidden; }
.voicebtn::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--red); }
