/* Hero demo: the vaki.chat desk as a guest sees it on a tour company's website.
   Every colour, radius and font the widget uses is a --hd-* variable on .hd, so a later step can fill
   them from a customer's own site (window.vakiHeroDemo.setTheme({...})). data-brand picks a ready palette,
   data-dark the dark surface. Nothing here depends on the rest of the page except the site's fonts. */
.hd {
  --hd-accent: #0B6268;          /* guest bubble, buttons, links */
  --hd-on-accent: #FFFFFF;
  --hd-accent-soft: #DCEEE7;      /* card badges */
  --hd-surface: #FFFFFF;          /* the widget */
  --hd-surface-2: #F3F6F4;        /* message area */
  --hd-bubble: #FFFFFF;           /* desk bubble */
  --hd-ink: #103B43;
  --hd-muted: #4F6A6E;
  --hd-line: #D5E2DE;
  --hd-radius: 18px;
  --hd-font: inherit;
  --hd-icon-bg: #081F2C;          /* the Vaki icon (mark B2) keeps its own colours in every palette */
  --hd-icon-v: #F4FBF6;
  --hd-icon-dot: #F08C2E;
  font-family: var(--hd-font);
  width: min(100%, 760px);
  margin: 26px auto 0;
  text-align: left;
  color: var(--hd-ink);
}
.hd[data-brand="glacier"] { --hd-accent: #1F4E8C; --hd-on-accent: #FFFFFF; --hd-accent-soft: #DDE7F5; --hd-radius: 12px; }
.hd[data-brand="lava"]    { --hd-accent: #A63A22; --hd-on-accent: #FFFFFF; --hd-accent-soft: #F6E1D9; --hd-radius: 6px; }
.hd[data-brand="moss"]    { --hd-accent: #3D6634; --hd-on-accent: #FFFFFF; --hd-accent-soft: #E1EDDB; --hd-radius: 22px; }
.hd[data-brand="fjord"]   { --hd-accent: #5B3F8C; --hd-on-accent: #FFFFFF; --hd-accent-soft: #E8E0F4; --hd-radius: 14px; }
.hd[data-dark="1"] {
  --hd-surface: #15232A;
  --hd-surface-2: #0E191F;
  --hd-bubble: #1E3038;
  --hd-ink: #EAF2EF;
  --hd-muted: #A7BBB8;
  --hd-line: #2C4148;
  --hd-accent-soft: #24414A;
}
.hd[data-dark="1"][data-brand="vaki"]    { --hd-accent: #3FA3A0; --hd-on-accent: #06222A; }
.hd[data-dark="1"][data-brand="glacier"] { --hd-accent: #6E9FE0; --hd-on-accent: #0A1A30; }
.hd[data-dark="1"][data-brand="lava"]    { --hd-accent: #E27755; --hd-on-accent: #2A0C04; }
.hd[data-dark="1"][data-brand="moss"]    { --hd-accent: #8DBF7E; --hd-on-accent: #10200C; }
.hd[data-dark="1"][data-brand="fjord"]   { --hd-accent: #A98BDB; --hd-on-accent: #1A0F2E; }

.hd-box {
  width: min(100%, 400px);
  background: var(--hd-surface);
  border: 1px solid var(--hd-line);
  border-radius: var(--hd-radius);
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(8, 31, 44, .08), 0 14px 30px -18px rgba(8, 31, 44, .45);
}
.hd-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--hd-line); }
.hd-icon { width: 36px; height: 36px; flex: none; display: block; }
.hd-icon .i-bg { fill: var(--hd-icon-bg); }
.hd-icon .i-v { fill: var(--hd-icon-v); }
.hd-icon .i-dot { fill: var(--hd-icon-dot); }
.hd-name { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.2; }
.hd-sub { margin: 2px 0 0; font-size: 13px; line-height: 1.3; color: var(--hd-muted); }
.hd-tag { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--hd-muted); border: 1px solid var(--hd-line); border-radius: 999px; padding: 3px 9px; }

.hd-log {
  list-style: none; margin: 0; padding: 14px 12px;
  height: 360px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--hd-surface-2);
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.hd-m { max-width: 86%; font-size: 14.5px; line-height: 1.45; }
.hd-m p { margin: 0; }
.hd-m.g { align-self: flex-end; background: var(--hd-accent); color: var(--hd-on-accent); padding: 9px 13px; border-radius: var(--hd-radius) var(--hd-radius) 4px var(--hd-radius); }
.hd-m.d { align-self: flex-start; background: var(--hd-bubble); color: var(--hd-ink); border: 1px solid var(--hd-line); padding: 9px 13px; border-radius: var(--hd-radius) var(--hd-radius) var(--hd-radius) 4px; }
.hd-m.typing { padding: 12px 14px; }
.hd-dots { display: inline-flex; gap: 4px; }
.hd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--hd-muted); opacity: .5; animation: hd-blink 1s infinite; }
.hd-dots i:nth-child(2) { animation-delay: .15s; }
.hd-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hd-blink { 50% { opacity: 1; } }

.hd-card { margin-top: 9px; border: 1px solid var(--hd-line); border-radius: calc(var(--hd-radius) * .6); padding: 10px 11px; background: var(--hd-surface); }
.hd-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.hd-card-name { font-weight: 700; font-size: 14px; }
.hd-badge { font-size: 12px; font-weight: 700; color: var(--hd-ink); background: var(--hd-accent-soft); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.hd-card-meta { margin: 4px 0 0; font-size: 13px; color: var(--hd-muted); }
.hd-card-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 9px; }
.hd-card-price { font-weight: 700; font-size: 14px; }
.hd-card-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--hd-accent); color: var(--hd-on-accent); font-weight: 700; font-size: 13px; }

.hd-input { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--hd-line); }
.hd-field { flex: 1; min-height: 40px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--hd-line); border-radius: 999px; color: var(--hd-muted); font-size: 14px; }
.hd-send { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--hd-accent); display: grid; place-items: center; }
.hd-send svg { width: 18px; height: 18px; stroke: var(--hd-on-accent); fill: none; stroke-width: 2; }

.hd-ctl { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.hd-ctl button {
  min-height: 44px; min-width: 44px; padding: 0 14px;
  font: 600 14px/1 var(--body, inherit);
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.hd-ctl button:hover { background: var(--foam); }
.hd-ctl button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.hd-ctl button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.hd-ctl svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.hd-swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--hd-accent); border: 1.5px solid currentColor; }
.hd-note { margin: 10px 0 0; text-align: center; font-size: 13px; line-height: 1.4; color: var(--ink2); }

/* Before the script runs (or with it off) every message shows, so the page still reads. */
.hd.is-playing .hd-m[hidden] { display: none; }

@media (max-width: 420px) {
  .hd-log { height: 330px; }
  .hd-ctl button { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-log { scroll-behavior: auto; }
  .hd-dots i { animation: none; opacity: .8; }
}

/* The frame. The town drawing is the old kayak section's art, unchanged: same lines, same colour (the site's --teal, mint in
   Dark mode), same 2:1 shape (3:2 on a phone). It sits at the top of the frame at full width, so the mountains run across
   the top, and the chat box overlaps its lower part: the town shows beside the chat box too. The chat box keeps its own
   surface, so no line ever runs behind a word. The padding is a share of the width, so the overlap scales with the art. */
.hd-frame {
  position: relative; isolation: isolate; display: flex; justify-content: center;
  padding: 22% 28px 40px;
  border-radius: 20px; overflow: hidden;
  background: var(--paper); outline: 2px solid var(--ink); outline-offset: -2px; box-shadow: 0 5px 0 var(--aqua);
}
.hd-frame > .eyjar-art.engrave {
  position: absolute; top: 0; left: 0; z-index: -1; width: 100%; height: auto; aspect-ratio: 2 / 1; animation: none;
}
@media (max-width: 640px) {
  .hd-frame { padding: 46% 12px 22px; border-radius: 16px; }
  .hd-frame > .eyjar-art.engrave { aspect-ratio: 3 / 2; }
}
