/* More of Hartvig (hartvig-scenes.mjs): the notepad at the Agent's questions,
   the unplugged plug while offline and the z's at the logo late at night.
   No sound; reduced motion is still. */
.hartvig-s-figure { display: block; }
.hartvig-s-figure svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* 1. The Agent's questions: he takes notes in the empty preview. */
.builder-preview-status.has-hartvig-questions > :not(.hartvig-questions) { display: none; }
.hartvig-questions { display: flex; align-items: center; gap: 22px; max-width: 560px; text-align: start; }
.hartvig-questions-figure { flex: none; width: 150px; height: 150px; transform-origin: 50% 100%; filter: drop-shadow(0 12px 18px rgba(240,68,145,.25)); }
.hartvig-questions .hartvig-pencil { transform-box: view-box; transform-origin: 175px 57px; animation: hartvig-write .45s ease-in-out infinite alternate; }
.hartvig-questions .hartvig-notepad-tick { transition: opacity .25s ease; }
.hartvig-questions[data-done="1"] .hartvig-notepad-tick.is-1,
.hartvig-questions[data-done="2"] .hartvig-notepad-tick:is(.is-1, .is-2),
.hartvig-questions[data-done="3"] .hartvig-notepad-tick { opacity: 1; }
.hartvig-questions.is-still .hartvig-pencil { animation: none; }
@keyframes hartvig-write { from { transform: rotate(-6deg) translate(-1px, 0); } to { transform: rotate(5deg) translate(2px, 3px); } }
.hartvig-questions-pad {
  display: grid; gap: 8px; min-width: 0; width: min(330px, 100%); padding: 16px 18px;
  border: 1px solid rgba(240,68,145,.28); border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
}
.builder-preview-status .hartvig-questions-title { color: #f7f4fa; font-size: 16px; line-height: 1.3; }
.hartvig-questions-copy, .hartvig-questions-count { margin: 0; font-size: 12.5px; line-height: 1.5; }
.hartvig-questions-count { color: #e9bfd3; font-weight: 650; font-variant-numeric: tabular-nums; }
.hartvig-questions.is-done .hartvig-questions-copy { color: #86efac; font-weight: 600; }
.hartvig-questions-list { display: grid; gap: 6px; margin: 2px 0; padding: 0; list-style: none; }
.hartvig-questions-list li { display: flex; align-items: flex-start; gap: 8px; color: #cac4ce; font-size: 12.5px; line-height: 1.4; }
.builder-preview-status .hartvig-questions-list span { max-width: none; }
.hartvig-questions-mark { flex: none; width: 16px; height: 16px; margin-top: 1px; border: 1.5px solid rgba(255,255,255,.28); border-radius: 50%; }
.hartvig-questions-list li.is-answered { color: #f2edf4; }
.hartvig-questions-list li.is-answered .hartvig-questions-mark { border-color: #22c55e; background: #22c55e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.6' stroke='%23fff' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; animation: hartvig-tick .3s cubic-bezier(.3,1.6,.5,1); }
.hartvig-questions.is-still .hartvig-questions-mark { animation: none; }
@keyframes hartvig-tick { from { transform: scale(.4); } to { transform: none; } }
html[data-theme="light"] .hartvig-questions-pad { border-color: rgba(240,68,145,.3); background: #fff; box-shadow: 0 16px 36px rgba(60,20,60,.10); }
html[data-theme="light"] .builder-preview-status .hartvig-questions-title { color: #1e2124; }
html[data-theme="light"] .hartvig-questions-count { color: #b0336f; }
html[data-theme="light"] .hartvig-questions.is-done .hartvig-questions-copy { color: #15803d; }
html[data-theme="light"] .hartvig-questions-list li { color: #5d4f66; }
html[data-theme="light"] .hartvig-questions-list li.is-answered { color: #2a1730; }
html[data-theme="light"] .hartvig-questions-mark { border-color: rgba(42,23,48,.25); }
@media (max-width: 640px) {
  .hartvig-questions { flex-direction: column; gap: 10px; }
  .hartvig-questions-figure { width: 120px; height: 120px; }
}

/* 5. Offline: he holds the plug toward the socket, and it clicks in when the
   connection is back. */
.hartvig-offline {
  position: fixed; z-index: 2147483000; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 8px 18px 8px 10px;
  border: 1px solid rgba(251,191,36,.45); border-radius: 18px;
  background: #1d1724; color: #fde68a; box-shadow: 0 18px 44px rgba(0,0,0,.4);
  font-size: 13.5px; font-weight: 650; line-height: 1.4;
  animation: hartvig-offline-in .35s cubic-bezier(.3,1.4,.5,1);
}
.hartvig-offline.is-back { border-color: rgba(34,197,94,.55); color: #86efac; }
.hartvig-offline.is-leaving { opacity: 0; transform: translate(-50%, 12px); transition: opacity .35s ease, transform .35s ease; }
@keyframes hartvig-offline-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translateX(-50%); } }
.hartvig-offline-scene { position: relative; flex: none; width: 96px; height: 64px; }
.hartvig-socket { position: absolute; left: 0; top: 30px; width: 18px; height: 24px; display: flex; gap: 3px; align-items: center; justify-content: center; border-radius: 5px; background: #e2e8f0; box-shadow: inset 0 -2px rgba(0,0,0,.12); }
.hartvig-socket i { width: 3px; height: 7px; border-radius: 1px; background: #334155; }
.hartvig-offline-figure { position: absolute; left: 30px; top: 0; width: 64px; height: 64px; animation: hartvig-reach 2.4s ease-in-out infinite; }
.hartvig-offline.is-back .hartvig-offline-figure { animation: none; transform: translateX(-4px); transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
@keyframes hartvig-reach { 0%, 100% { transform: translateX(2px); } 45%, 60% { transform: translateX(-2px) rotate(-3deg); } }
.hartvig-offline-spark { position: absolute; left: 14px; top: 26px; width: 14px; height: 30px; opacity: 0; pointer-events: none; }
.hartvig-offline-spark i { position: absolute; left: 6px; top: 12px; width: 2px; height: 7px; border-radius: 1px; background: #fde047; }
.hartvig-offline-spark i:nth-child(1) { transform: rotate(-50deg) translateY(-10px); }
.hartvig-offline-spark i:nth-child(2) { transform: translateY(-11px); }
.hartvig-offline-spark i:nth-child(3) { transform: rotate(50deg) translateY(-10px); }
.hartvig-offline.is-back .hartvig-offline-spark { animation: hartvig-spark .5s ease-out .2s both; }
@keyframes hartvig-spark { 0% { opacity: 0; transform: scale(.5); } 40% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.3); } }
.hartvig-offline.is-still, .hartvig-offline.is-still * { animation: none !important; transition: none !important; }
html[data-theme="light"] .hartvig-offline { background: #fffbeb; color: #92400e; box-shadow: 0 16px 36px rgba(60,40,10,.16); }
html[data-theme="light"] .hartvig-offline.is-back { background: #f0fdf4; color: #15803d; }
html[data-theme="light"] .hartvig-socket { background: #cbd5e1; }

/* 6. Late at night: small z's float up from him at the logo. */
.hartvig-zzz { display: none; position: absolute; left: 34px; top: 4px; width: 22px; height: 26px; pointer-events: none; }
html.hartvig-night .hartvig-zzz { display: block; }
.hartvig-zzz i { position: absolute; left: 0; bottom: 0; color: #a5b4fc; font: italic 800 10px/1 Inter, system-ui, sans-serif; opacity: 0; animation: hartvig-zzz 3.6s ease-out infinite; }
.hartvig-zzz i:nth-child(2) { font-size: 8px; animation-delay: 1.2s; }
.hartvig-zzz i:nth-child(3) { font-size: 12px; animation-delay: 2.4s; }
@keyframes hartvig-zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: .95; } 100% { opacity: 0; transform: translate(10px, -22px) scale(1.1); } }
.hartvig-stage[class*="idle-"] .hartvig-zzz { display: none; }
html[data-theme="light"] .hartvig-zzz i { color: #6366f1; }
@media (prefers-reduced-motion: reduce) {
  .hartvig-questions .hartvig-pencil, .hartvig-questions-mark, .hartvig-offline, .hartvig-offline * { animation: none !important; transition: none !important; }
  .hartvig-zzz i { animation: none; opacity: .8; }
  .hartvig-zzz i:nth-child(1) { transform: translate(0, -2px); }
  .hartvig-zzz i:nth-child(2) { transform: translate(6px, -10px); }
  .hartvig-zzz i:nth-child(3) { transform: translate(12px, -20px); }
}
