/* DAR Interview — чат-интервьюер. Spatial Glass BaiMuras, mobile-first. */
:root {
  --glass: rgba(30, 31, 34, 0.62);
  --glass2: rgba(255, 255, 255, 0.07);
  --glass3: rgba(255, 255, 255, 0.12);
  --glassbrd: rgba(255, 255, 255, 0.10);
  --ink: #f2f4f7; --ink2: rgba(255, 255, 255, 0.74); --ink3: rgba(255, 255, 255, 0.48);
  --gr: #00e5a0; --blue: #477fec; --err: #e86a6a;
  --soft-sh: 0 6px 18px rgba(10, 10, 12, .22), 0 24px 60px -20px rgba(10, 10, 12, .45);
  --eo: cubic-bezier(.23, 1, .32, 1);
  --r: 20px; --r2: 14px; --rp: 999px;
  --blur: blur(26px) saturate(1.2) brightness(1.03);
  --top-h: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  margin: 0; min-height: 100dvh; background: #17181a; color: var(--ink);
  font-family: "Golos Text", system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
.disp { font-family: "Unbounded", "Golos Text", sans-serif; letter-spacing: -.02em; }
.wall {
  position: fixed; inset: 0; z-index: -1;
  background: #17181a url("w01.jpg") center/cover no-repeat;
}
.wall::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,13,15,.72), rgba(12,13,15,.86)); }
.glass { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glassbrd); }

/* шапка */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  border-width: 0 0 1px; min-height: var(--top-h);
}
.brand { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink2); min-width: 0; }
.brand b { color: var(--ink); font-weight: 700; }
.brand b em { font-style: normal; color: var(--gr); }
.brand .sep { color: var(--ink3); }
.brand .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb { width: 8px; height: 8px; border-radius: 50%; background: var(--gr); box-shadow: 0 0 10px var(--gr); flex: none; }
.right { display: flex; align-items: center; gap: 8px; flex: none; }
.cov { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink2); }
.covbar { width: 54px; height: 5px; border-radius: var(--rp); background: var(--glass2); overflow: hidden; }
.covbar i { display: block; height: 100%; width: 0; background: var(--gr); border-radius: var(--rp); transition: width .5s var(--eo); }
.ghost {
  font: inherit; font-size: 13px; color: var(--ink); background: var(--glass2);
  border: 1px solid var(--glassbrd); border-radius: var(--rp); padding: 7px 14px; cursor: pointer;
}
.ghost:hover { background: var(--glass3); }

/* лента */
.chat { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 14px 8px; }
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; display: flex; flex-direction: column; gap: 4px; animation: rise .4s var(--eo) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .msg { animation: none; } .covbar i { transition: none; } }
.msg .who { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); padding: 0 4px; }
.bubble {
  padding: 13px 16px; border-radius: var(--r); white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glassbrd); box-shadow: var(--soft-sh);
}
.msg.a { align-self: flex-start; }
.msg.a .bubble { border-bottom-left-radius: 6px; }
.msg.u { align-self: flex-end; align-items: flex-end; }
.msg.u .bubble { background: rgba(71, 127, 236, .26); border-color: rgba(71, 127, 236, .38); border-bottom-right-radius: 6px; }
.msg.final .bubble { border-color: rgba(0, 229, 160, .34); box-shadow: 0 14px 40px -16px rgba(0, 229, 160, .3); }
.bubble h2, .bubble h3 { font-family: "Unbounded", sans-serif; font-size: 15px; margin: 14px 0 6px; letter-spacing: -.01em; }
.bubble h2:first-child, .bubble h3:first-child { margin-top: 0; }
.bubble strong { color: #fff; }
.bubble .tag { display: inline-block; font-size: 11px; color: var(--ink3); }
.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .18s; } .typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* вход */
.gate { max-width: 560px; margin: 6vh auto 0; padding: 26px 22px; border-radius: var(--r);
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glassbrd); box-shadow: var(--soft-sh); }
.gate h1 { font-size: 24px; margin: 0 0 10px; }
.gate .lead { color: var(--ink2); margin: 0 0 20px; }
#enter { display: flex; gap: 10px; flex-wrap: wrap; }
#name { flex: 1 1 200px; min-width: 0; font: inherit; padding: 13px 15px; border-radius: var(--r2);
  border: 1px solid var(--glassbrd); background: var(--glass2); color: var(--ink); outline: none; }
#name:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(71, 127, 236, .25); }
.primary { font: inherit; font-weight: 600; padding: 13px 22px; border-radius: var(--r2); border: 0;
  background: var(--gr); color: #06231a; cursor: pointer; }
.primary:hover { filter: brightness(1.06); }
.err { color: var(--err); font-size: 14px; margin: 12px 0 0; }

/* композер */
.composer {
  position: sticky; bottom: 0; z-index: 20; display: flex; align-items: flex-end; gap: 8px;
  width: 100%; max-width: 760px; margin: 0 auto; padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom)); border-width: 1px 0 0;
}
#input {
  flex: 1; min-width: 0; font: inherit; resize: none; max-height: 42vh; padding: 11px 14px;
  border-radius: var(--r2); border: 1px solid var(--glassbrd); background: var(--glass2);
  color: var(--ink); outline: none; line-height: 1.45;
}
#input:focus { border-color: rgba(255, 255, 255, .22); }
.icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer;
  border-radius: var(--rp); border: 1px solid var(--glassbrd); background: var(--glass2); color: var(--ink2); }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon:hover { background: var(--glass3); color: var(--ink); }
.icon.send { background: var(--gr); border-color: transparent; color: #06231a; }
.icon.send:disabled { opacity: .4; cursor: default; }
.icon.mic.on { background: rgba(232, 106, 106, .22); border-color: rgba(232, 106, 106, .5); color: #ffd9d9;
  animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(232, 106, 106, .12); } }

.toast { position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 40; padding: 11px 18px; border-radius: var(--rp); font-size: 14px; box-shadow: var(--soft-sh); max-width: 90vw; }

@media (min-width: 720px) { body { font-size: 15px; } .msg { max-width: 78%; } .gate h1 { font-size: 28px; } }
