/* heroone.art · Book with 3nity Auracle (styles follow 333Bi Tech auracle-ui.css chat) */
#hx-book { --bk-gold: #c9a84c; --bk-gold-rgb: 201 168 76; --bk-teal: #4ff0e0; --bk-line: rgb(255 255 255 / .08); --bk-line-strong: rgb(255 255 255 / .15); --bk-text: #f0f2f8; --bk-muted: rgb(196 201 216 / .8); --bk-dim: rgb(140 146 166 / .95);
  --bk-ease: cubic-bezier(.2, .8, .2, 1); --bk-spring: cubic-bezier(.34, 1.56, .64, 1);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--bk-text); }
#hx-book * { box-sizing: border-box; }
#hx-book .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bk {
  position: fixed; z-index: 160;
  right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(430px, calc(100vw - 2rem)); height: min(690px, calc(100svh - 2rem));
  display: flex; flex-direction: column;
  border-radius: 26px; overflow: hidden;
  background: linear-gradient(180deg, rgb(16 19 29 / .95), rgb(7 9 15 / .98));
  border: 1px solid rgb(var(--bk-gold-rgb) / .3);
  box-shadow: 0 40px 100px -30px rgb(0 0 0 / .95), 0 0 0 1px rgb(255 255 255 / .03) inset;
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  opacity: 0; transform: translateY(24px) scale(.96); transform-origin: bottom right;
  transition: opacity .35s var(--bk-ease), transform .5s var(--bk-spring);
}
.bk.is-open { opacity: 1; transform: none; }
.bk[hidden] { display: none; }
.bk__head { position: relative; z-index: 2; display: flex; align-items: center; gap: .75rem; padding: .85rem .85rem .85rem 1rem; border-bottom: 1px solid var(--bk-line); background: linear-gradient(180deg, rgb(var(--bk-gold-rgb) / .09), transparent); }
.bk__mark { width: 54px; height: 54px; flex: none; }
.bk__mark .ah, .bk__mark img { width: 100%; }
.bk__title { flex: 1; min-width: 0; }
.bk__title h2 { margin: 0; font-family: "Syne", system-ui, sans-serif; font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em; }
.bk__status { display: flex; align-items: center; gap: .4rem; margin: .15rem 0 0; color: var(--bk-dim); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk__status i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; flex: none; }
.bk__status[data-field='thinking'] i { background: var(--bk-teal); box-shadow: 0 0 8px var(--bk-teal); animation: bk-pulse .8s ease-in-out infinite; }
.bk__status[data-field='speaking'] i { background: var(--bk-gold); box-shadow: 0 0 8px var(--bk-gold); animation: bk-pulse .5s ease-in-out infinite; }
@keyframes bk-pulse { 50% { opacity: .35; } }
.bk__icon { width: 36px; height: 36px; flex: none; border-radius: 11px; cursor: pointer; background: rgb(255 255 255 / .04); border: 1px solid var(--bk-line); font-size: 1.1rem; line-height: 1; color: var(--bk-muted); }
.bk__icon:hover { color: var(--bk-text); border-color: rgb(var(--bk-gold-rgb) / .45); }
.bk__body { position: relative; flex: 1; min-height: 0; }
.bk__field { position: absolute; left: 50%; top: 45%; width: 130%; transform: translate(-50%, -50%); opacity: .45; pointer-events: none; }
.bk__log { position: relative; z-index: 1; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 1.1rem 1rem 1.4rem; display: flex; flex-direction: column; gap: .9rem; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .12) transparent; }
.bk-msg { max-width: 90%; display: flex; flex-direction: column; gap: .55rem; animation: bk-in .45s var(--bk-spring) both; }
@keyframes bk-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.bk-msg--u { align-self: flex-end; }
.bk-msg--a { align-self: flex-start; }
.bk-msg__t { padding: .75rem .95rem; border-radius: 18px; font-size: .93rem; line-height: 1.55; overflow-wrap: anywhere; }
.bk-msg--u .bk-msg__t { color: #140f05; font-weight: 500; background: linear-gradient(135deg, #f3dc98, var(--bk-gold)); border-bottom-right-radius: 6px; }
.bk-msg--a .bk-msg__t { background: rgb(18 21 31 / .85); border: 1px solid var(--bk-line-strong); border-bottom-left-radius: 6px; backdrop-filter: blur(8px); }
.bk-msg__t strong { color: #ecd28a; font-weight: 600; }
.bk-msg--u .bk-msg__t strong { color: inherit; }
.bk-acts { display: flex; flex-wrap: wrap; gap: .4rem; }
.bk-act { display: inline-flex; align-items: center; padding: .5rem .85rem; border-radius: 999px; cursor: pointer; font: 600 .8rem/1.2 inherit; font-family: inherit; color: var(--bk-text); text-decoration: none; background: rgb(255 255 255 / .05); border: 1px solid var(--bk-line-strong); transition: border-color .25s, background .25s, transform .3s var(--bk-spring); }
.bk-act:hover { border-color: rgb(var(--bk-gold-rgb) / .55); background: rgb(var(--bk-gold-rgb) / .1); transform: translateY(-1px); }
.bk-act--gold { color: #140f05; background: linear-gradient(135deg, #f3dc98, var(--bk-gold)); border-color: transparent; }
.bk-act--gold:hover { background: linear-gradient(135deg, #f8e6b0, #d8b85c); }
.bk-act:focus-visible, .bk__icon:focus-visible, .bk__send:focus-visible { outline: 2px solid var(--bk-gold); outline-offset: 2px; }
.bk-card { margin: 0; padding: .9rem 1rem; border-radius: 16px; background: rgb(10 12 19 / .85); border: 1px solid rgb(var(--bk-gold-rgb) / .3); display: grid; gap: .55rem; font-size: .86rem; }
.bk-card div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: .6rem; }
.bk-card dt { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--bk-dim); padding-top: .2rem; }
.bk-card dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.bk-typing { display: inline-flex; gap: 5px; padding: .9rem 1rem; border-radius: 18px; border-bottom-left-radius: 6px; background: rgb(18 21 31 / .85); border: 1px solid var(--bk-line-strong); }
.bk-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--bk-teal); animation: bk-typing 1.1s ease-in-out infinite; }
.bk-typing span:nth-child(2) { animation-delay: .15s; } .bk-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bk-typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.bk__composer { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: .5rem; margin: 0 .8rem; padding: .45rem .45rem .45rem .9rem; border-radius: 18px; background: rgb(255 255 255 / .05); border: 1px solid var(--bk-line-strong); transition: border-color .25s, box-shadow .25s; }
.bk__composer:focus-within { border-color: rgb(var(--bk-gold-rgb) / .55); box-shadow: 0 0 0 4px rgb(var(--bk-gold-rgb) / .1); }
.bk__composer textarea { flex: 1; min-width: 0; resize: none; max-height: 120px; field-sizing: content; padding: .45rem 0; border: 0; outline: none; background: none; color: var(--bk-text); font: inherit; font-size: 1rem; line-height: 1.4; }
.bk__composer textarea::placeholder { color: var(--bk-dim); }
.bk__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.bk__send { width: 40px; height: 40px; flex: none; border-radius: 13px; border: 0; cursor: pointer; display: grid; place-items: center; color: #140f05; background: linear-gradient(135deg, #f3dc98, var(--bk-gold)); transition: transform .3s var(--bk-spring); }
.bk__send svg { width: 20px; height: 20px; }
.bk__send:hover { transform: translateX(2px); }
.bk__foot { margin: 0; padding: .6rem 1rem .8rem; text-align: center; color: var(--bk-dim); font-size: .6rem; letter-spacing: .06em; }
.bk__foot a { color: var(--bk-gold); }
/* HEAD speaking state (from 333Bi Tech): eyes follow the voice, headset pulses */
#hx-persist #hx-book .ah[data-state='speaking']:not(.is-boot) .ah-body { animation: ah-sway 6s ease-in-out infinite; }
#hx-persist #hx-book .ah[data-state='speaking']:not(.is-boot) .ah-eyes { animation: bk-voice .62s ease-in-out infinite; }
#hx-persist #hx-book .ah[data-state='speaking']:not(.is-boot) .ah-pulse { animation: ah-pulse 1.38s ease-out infinite; animation-delay: var(--ah-d); }
#hx-persist #hx-book .ah[data-state='playing']:not(.is-boot) .ah-cup { opacity: .55; animation: ah-breathe 1.8s ease-in-out infinite; }
@keyframes bk-voice { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
html.bk-open #hx-persist .hx-dock { opacity: .25; }
@media (max-width: 560px) {
  .bk { right: 0; bottom: 0; width: 100vw; height: 100svh; border-radius: 0; border: 0; transform-origin: bottom center; }
  html.bk-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .bk, .bk-msg { animation: none; transition: none; } }
