/* aivisionbot.com — interactive app demo (#app) and animated walkthrough (#tour)
   Scoped to #app / #tour so nothing else on the page can move.
   Transform and opacity only. Tokens come from css/site.css; nothing new is invented here
   except the local --dk detection colour alias and the dark stage surface. */

#app, #tour { --dk: #84cc16; --stage: #0b1220; --stage-2: #101a2e; --avb-r: 12px; }

/* ============================================================ shared section chrome */
.avbsec { padding: 88px 0; }
.avbsec .sec-head { max-width: 820px; }
@media (max-width: 760px) { .avbsec { padding: 62px 0; } }

/* ============================================================ A. browser + app frame */
.avbf {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--sh); overflow: hidden; position: relative;
}
.avbf-bar {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px;
  background: linear-gradient(#fbfcfe, #f4f7fc); border-bottom: 1px solid var(--line);
}
.avbf-dots { display: flex; gap: 6px; }
.avbf-dots i { width: 9px; height: 9px; border-radius: 50%; background: #dfe6f0; }
.avbf-dots i:nth-child(1) { background: #f6c9c9; }
.avbf-dots i:nth-child(2) { background: #f7e0b4; }
.avbf-dots i:nth-child(3) { background: #c8e6c2; }
.avbf-url {
  flex: 1; display: flex; align-items: center; gap: 8px; justify-content: center;
  max-width: 420px; margin: 0 auto; height: 26px; padding: 0 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  font-size: .76rem; font-weight: 600; letter-spacing: .01em; overflow: hidden; white-space: nowrap;
}
.avbf-url .ic { width: 13px; height: 13px; color: var(--ok); }
.avbf-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent-deep);
  background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 999px; padding: 3px 9px;
}
.avbf-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* app header row */
.avbapp { background: #fff; }
.avbapp-hd {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: #fff; flex-wrap: wrap;
}
.avbmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); font-size: .96rem; }
.avbmark .ic { width: 18px; height: 18px; color: var(--accent); }
.avbapp-org { font-size: .78rem; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; }
.avbapp-chips { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.avbchip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700;
  color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}
.avbchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.avbchip-ok { color: #14532d; background: var(--ok-bg); border-color: #cde9d6; }
.avbchip-ok i { background: var(--ok); box-shadow: 0 0 0 3px rgba(21,128,61,.14); }
.avbchip-warn { color: #7c2d12; background: var(--warn-bg); border-color: #f2ddbd; }
.avbchip-warn i { background: var(--warn); }

/* tab strip */
.avbt {
  display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; background: #fff;
  --fl: 0px; --fr: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
}
.avbt[data-fl="1"] { --fl: 26px; }
.avbt[data-fr="1"] { --fr: 30px; }
@media (min-width: 641px) { .avbt { --fl: 0px; --fr: 0px; } }
.avbt::-webkit-scrollbar { display: none; }
.avbt-b {
  position: relative; flex: none; appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 700; color: var(--muted);
  padding: 13px 12px 12px; border-radius: 8px 8px 0 0; white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.avbt-b::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.avbt-b:hover { color: var(--ink); background: #f8fafd; }
.avbt-b[aria-selected="true"] { color: var(--accent-deep); }
.avbt-b[aria-selected="true"]::after { transform: scaleX(1); }

/* panels: stacked in one cell so a swap never moves the page */
.avbp { display: grid; }
.avbpanel {
  grid-area: 1 / 1; min-width: 0; padding: 18px 16px 20px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .32s var(--ease);
}
.avbpanel[data-on="1"] { opacity: 1; visibility: visible; pointer-events: auto; }

/* panel furniture */
.avb-say { margin: 0 0 14px; font-size: 1rem; color: var(--ink); line-height: 1.55; }
.avb-say b { color: var(--accent-deep); }
.avb-h {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: .76rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.avb-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.avb-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.avb-kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--avb-r); padding: 12px 13px; }
.avb-kpi span { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.avb-kpi b {
  display: block; margin-top: 6px; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.45rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.avb-kpi small { display: block; margin-top: 4px; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.avb-kpi-acc { background: var(--accent-tint); border-color: var(--accent-line); }
.avb-kpi-acc b { color: var(--accent-deep); }

/* needs a person */
.avb-need { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--avb-r); background: #fff; margin-bottom: 8px; }
.avb-need:last-child { margin-bottom: 0; }
.avb-need .ic { width: 16px; height: 16px; color: var(--warn); }
.avb-need .t { flex: 1; min-width: 0; font-size: .88rem; font-weight: 700; color: var(--ink); }
.avb-need .t small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.avb-need .go { font-size: .72rem; font-weight: 800; color: var(--accent-deep); white-space: nowrap; }
.avb-need-warn { background: #fffdf6; border-color: #f3e4c4; }

/* ---------------------------------------------------------- live wall */
.avb-live { position: relative; }
.avb-gr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 1000px) { .avb-gr { grid-template-columns: repeat(4, 1fr); gap: 8px; } }
.avb-tile { position: relative; margin: 0; border-radius: var(--avb-r); overflow: hidden; background: #0b1220; aspect-ratio: 16 / 9; isolation: isolate; }
.avb-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.92) contrast(1.04); }
.avb-tile-top {
  position: absolute; inset: 6px 6px auto 6px; display: flex; align-items: center; gap: 6px; z-index: 3;
  font-size: .68rem; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
.avb-livechip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px;
  background: rgba(220, 38, 38, .92); font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.avb-livechip i { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: avb-blink 2.4s steps(1, end) infinite; }
.avb-tile time { margin-left: auto; font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; opacity: .95; }
.avb-tile-name {
  position: absolute; inset: auto 8px 4px 8px; z-index: 3; font-size: .65rem; line-height: 1.25; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6); display: flex; justify-content: space-between; gap: 8px;
}
.avb-tile-name em { font-style: normal; font-weight: 600; opacity: .8; }

/* detection box: four corner ticks drawn with background gradients — no extra elements */
.avbox {
  position: absolute; z-index: 2; pointer-events: none;
  left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: calc(var(--w) * 1%); height: calc(var(--h) * 1%);
  --tk: 13px; --tw: 2px;
  background-image:
    linear-gradient(var(--dk), var(--dk)), linear-gradient(var(--dk), var(--dk)),
    linear-gradient(var(--dk), var(--dk)), linear-gradient(var(--dk), var(--dk)),
    linear-gradient(var(--dk), var(--dk)), linear-gradient(var(--dk), var(--dk)),
    linear-gradient(var(--dk), var(--dk)), linear-gradient(var(--dk), var(--dk));
  background-repeat: no-repeat;
  background-size: var(--tk) var(--tw), var(--tw) var(--tk), var(--tk) var(--tw), var(--tw) var(--tk),
                   var(--tk) var(--tw), var(--tw) var(--tk), var(--tk) var(--tw), var(--tw) var(--tk);
  background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
  /* no drop-shadow: a filter on an animated element forces a re-raster every frame */
  animation: avb-breathe 3.6s ease-in-out infinite alternate;
}
.avbox[data-n="2"] { animation-duration: 4.4s; animation-delay: -1.1s; }
.avbox[data-n="3"] { animation-duration: 3.1s; animation-delay: -.6s; }
.avbox .lb {
  position: absolute; left: -1px; bottom: calc(100% + 4px); display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 6px; border-radius: 5px; background: rgba(11, 18, 32, .86); color: #fff;
  font-size: .62rem; font-weight: 700; white-space: nowrap; letter-spacing: .01em;
}
.avbox .lb b { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--dk); font-weight: 700; }
.avbox-tall .lb { bottom: auto; top: calc(100% + 4px); }
.avb-tile .avbox .lb,
.avb-prev .avbox .lb {
  bottom: auto; top: 1px; left: 0; right: auto;
  width: max-content; max-width: none;
  font-size: .58rem; padding: 1px 4px; border-radius: 3px;
}
.avb-tile::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; z-index: 2; pointer-events: none; background: linear-gradient(to top, rgba(11, 18, 32, .78), rgba(11, 18, 32, 0)); }
.avb-prev .avbox .lb { font-size: .54rem; padding: 1px 3px; border-radius: 3px; }

/* four small facts under the briefing list — earns the height the frame already reserves */
.avb-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.avb-fact { border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; padding: 8px 10px; }
.avb-fact span { display: block; font-size: .68rem; font-weight: 700; color: var(--muted); }
.avb-fact b {
  display: block; margin-top: 3px; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.02rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2;
}
.avb-fact small { display: block; margin-top: 2px; font-size: .64rem; color: var(--muted); }

/* recording strip + recent clips under the live wall */
.avb-tl { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .72rem; color: var(--muted); }
.avb-tl-l { font-weight: 800; letter-spacing: .05em; text-transform: uppercase; font-size: .66rem; color: var(--ink-2); white-space: nowrap; }
.avb-tl-l::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #dc2626; vertical-align: 1px; }
.avb-tl-bar { position: relative; flex: 1; height: 14px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.avb-tl-bar .seg { position: absolute; top: 0; bottom: 0; left: calc(var(--a) * 1%); width: calc((var(--b) - var(--a)) * 1%); background: #dbe7ff; }
.avb-tl-bar .seg:nth-child(even) { background: #cddcff; }
.avb-tl-bar .now { position: absolute; top: -2px; bottom: -2px; left: calc(var(--p) * 1%); width: 2px; background: var(--accent); }
.avb-tl-r { white-space: nowrap; font-variant-numeric: tabular-nums; }
.avb-clips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.avb-clips figure { position: relative; margin: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 8.4; background: #0b1220; }
.avb-clips img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.avb-clips figcaption {
  position: absolute; left: 0; bottom: 0; padding: 2px 6px; font-size: .64rem; font-weight: 700; color: #fff;
  background: rgba(11, 18, 32, .72); border-top-right-radius: 6px; font-variant-numeric: tabular-nums;
}

/* scan line */
.avscan {
  position: absolute; left: 0; right: 0; top: 0; height: 22%; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, rgba(132, 204, 22, 0), rgba(132, 204, 22, .22) 60%, rgba(132, 204, 22, 0));
  animation: avb-scan 4.8s linear infinite;
}
.avb-live[data-paused="1"] .avbox,
.avb-live[data-paused="1"] .avscan,
.avb-live[data-paused="1"] .avb-livechip i { animation-play-state: paused; }
.avb-live-ctl { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.avb-live-ctl .hint { font-size: .76rem; color: var(--muted); }

/* ---------------------------------------------------------- events stream */
.avb-ev { border: 1px solid var(--line); border-radius: var(--avb-r); overflow: hidden; background: #fff; }
.avb-row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fff;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), background-color .2s;
}
.avb-row:last-child { border-bottom: 0; }
.avb-row:hover, .avb-row:focus-within { transform: translateY(-1px); box-shadow: 0 8px 20px -14px rgba(15, 23, 42, .5); background: #fcfdff; }
.avb-row .ph { width: 76px; height: 44px; border-radius: 7px; overflow: hidden; background: #0b1220; position: relative; }
.avb-row .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avb-row .ph b {
  position: absolute; left: 3px; top: 3px; width: 8px; height: 8px; border-radius: 2px;
  border: 1.5px solid var(--dk); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
.avb-row .m { min-width: 0; }
.avb-row .m .t { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 700; color: var(--ink); }
.avb-row .m .t time { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .74rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.avb-row .m .s { margin-top: 2px; font-size: .76rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.avb-row .r { display: flex; align-items: center; gap: 6px; }
.avb-tag { font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid; }
.avb-tag-hi { color: #991b1b; background: #fef2f2; border-color: #f6d4d4; }
.avb-tag-md { color: #92400e; background: var(--warn-bg); border-color: #f2ddbd; }
.avb-tag-lo { color: #334155; background: var(--panel); border-color: var(--line); }
.avb-tag-cls { color: var(--detect-ink); background: #f2fce4; border-color: #d9efbe; text-transform: none; letter-spacing: 0; }
.avb-clip { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; color: var(--muted); }
.avb-clip .ic { width: 13px; height: 13px; color: var(--accent); }
.avb-new { animation: avb-slidein .5s var(--ease) both; }

/* ---------------------------------------------------------- detections */
.avb-drow { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--avb-r); background: #fff; margin-bottom: 8px; }
.avb-drow .ic { width: 17px; height: 17px; color: var(--accent); }
.avb-drow .t { flex: 1; min-width: 0; font-size: .88rem; font-weight: 700; color: var(--ink); }
.avb-drow .t small { display: block; font-weight: 500; font-size: .76rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.avsw {
  position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px; border: 1px solid #cfd8e6;
  background: #e6ecf5; cursor: pointer; padding: 0; transition: background-color .22s, border-color .22s;
}
.avsw i {
  position: absolute; top: 50%; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transform: translate(0, -50%); transition: transform .24s var(--ease); box-shadow: 0 1px 2px rgba(15, 23, 42, .3);
}
.avsw[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.avsw[aria-checked="true"] i { transform: translate(18px, -50%); }
.avsw-lb { font-size: .72rem; font-weight: 800; color: var(--muted); min-width: 26px; text-align: right; }
.avsw-lb[data-on="1"] { color: var(--ink); }
.avb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.avb-chip { font-size: .74rem; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.avb-chip.on { border-color: var(--detect); background: #f6ffe9; color: var(--detect-ink); }

.avb-conf { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 4px; }
.avb-prev { position: relative; border-radius: var(--avb-r); overflow: hidden; background: #0b1220; aspect-ratio: 16 / 10; }
.avb-prev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avb-prev .avbox { --tk: 11px; animation: none; filter: none; transition: opacity .3s; }
.avb-prev .avbox[data-off="1"] { opacity: .1; }
.avb-prev .avbox .lb { font-size: .58rem; }
.avb-slider-w { min-width: 0; }
.avb-slider-w label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .78rem; font-weight: 700; color: var(--ink); }
.avb-slider-w label output { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--accent-deep); }
.avb-slider-w input[type="range"] { width: 100%; margin: 10px 0 6px; accent-color: var(--accent); cursor: pointer; }
.avb-cap { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.5; min-height: 2.6em; }
.avb-cap b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- cameras */
.avb-cams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.avb-cam { border: 1px solid var(--line); border-radius: var(--avb-r); background: #fff; padding: 11px 12px; }
.avb-cam .nm { display: flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 700; color: var(--ink); }
.avb-cam .nm i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(21,128,61,.13); }
.avb-cam .meta { margin-top: 6px; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.55; }
.avb-cam .meta b { font-weight: 700; color: var(--ink-2); }
.avb-cam-down { border-color: #f2ddbd; background: #fffdf7; }
.avb-cam-down .nm i { background: var(--warn); box-shadow: 0 0 0 3px rgba(180,83,9,.14); }
.avb-cam-down .meta em { font-style: normal; font-weight: 700; color: #92400e; }

/* ---------------------------------------------------------- ask ai */
.avb-ask { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.avb-q {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--accent-line);
  border-radius: 14px; background: #fff; box-shadow: 0 10px 24px -20px rgba(37, 87, 214, .8);
}
.avb-q .ic { width: 16px; height: 16px; color: var(--accent); }
.avb-q .tx { flex: 1; min-width: 0; font-size: .88rem; color: var(--ink); }
.avb-q .cur { display: inline-block; width: 1px; height: 1.05em; vertical-align: -.16em; background: var(--accent); animation: avb-caret 1s steps(1, end) infinite; }
.avb-q .send { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.avb-q .send .ic { width: 14px; height: 14px; color: #fff; }
.avb-an { border: 1px solid var(--line); border-radius: var(--avb-r); background: #fff; padding: 13px 14px; }
.avb-an .who { display: flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 800; color: var(--accent-deep); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.avb-an .who .ic { width: 14px; height: 14px; }
.avb-an p { margin: 0; font-size: .9rem; line-height: 1.6; color: var(--ink-2); }
.avb-an p .cur { display: inline-block; width: 1.5px; height: 1em; vertical-align: -.15em; background: var(--accent); animation: avb-caret 1s steps(1, end) infinite; }
.avb-an-foot { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: end; margin-top: 12px; }
.avb-an-thumb { border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; background: #0b1220; position: relative; }
.avb-an-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avb-bars { display: flex; align-items: flex-end; gap: 6px; height: 62px; }
.avb-bars .b { flex: 1; height: 100%; background: linear-gradient(var(--accent), var(--accent-deep)); border-radius: 3px 3px 2px 2px; transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--ease); }
.avb-bars .b.on { transform: scaleY(var(--h)); }
.avb-bars .b span { position: absolute; }
.avb-bars-x { display: flex; gap: 6px; margin-top: 5px; }
.avb-bars-x span { flex: 1; text-align: center; font-size: .62rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.avb-follow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.avb-follow button {
  appearance: none; font: inherit; font-size: .76rem; font-weight: 600; color: var(--accent-deep); cursor: pointer;
  background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 999px; padding: 5px 11px;
  transition: background-color .2s, transform .2s var(--ease);
}
.avb-follow button:hover { background: #e3ecff; transform: translateY(-1px); }

/* honest demo note under the frame */
.avb-note { margin-top: 16px; font-size: .84rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.avb-note .ic { width: 15px; height: 15px; color: var(--accent); margin-top: 2px; }

/* ============================================================ B. tour stage */
.avtw { position: relative; }
.avt-stage {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-panel); overflow: hidden;
  background: radial-gradient(120% 90% at 70% 10%, #16233d 0%, var(--stage) 55%, #070c16 100%);
  box-shadow: var(--sh-lift); container-type: inline-size; isolation: isolate;
}
.avt-stage::after { /* top scrim so the control bar stays readable on any frame */
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(to bottom, rgba(7, 12, 22, .55) 0%, rgba(7, 12, 22, 0) 22%);
}
.avt-ch { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .55s var(--ease); z-index: 5; }
.avt-ch[data-on="1"] { opacity: 1; visibility: visible; z-index: 6; }

/* frame photo shared by chapters 1 and 2 */
.avt-shot { position: absolute; inset: 0; }
.avt-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avt-shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7,12,22,.55), rgba(7,12,22,0) 45%); }

/* chapter caption (bottom-left, above the vignette) */
.avt-cap {
  position: absolute; left: 2.2cqw; bottom: 5.2cqw; z-index: 7; max-width: 66%;
  padding: 1.2cqw 2cqw 1.2cqw 2.2cqw; border-radius: 1.2cqw;
  background: radial-gradient(120% 130% at 0% 100%, rgba(7, 12, 22, .72) 0%, rgba(7, 12, 22, .28) 55%, rgba(7, 12, 22, 0) 100%);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
}
.avt-cap b { display: block; font-family: 'DM Sans', 'Inter', sans-serif; color: #fff; font-size: max(2.6cqw, 12px); line-height: 1.15; letter-spacing: -.01em; }
.avt-cap span { display: block; margin-top: .5cqw; color: #a9bad6; font-size: max(1.5cqw, 9px); font-weight: 600; }
.avt-dots {
  position: absolute; right: 4.2cqw; bottom: 6.4cqw; z-index: 6; display: flex; gap: 1.4cqw; align-items: center;
}
.avt-dot {
  appearance: none; border: 0; cursor: pointer; padding: 0; width: max(2.2cqw, 8px); height: max(2.2cqw, 8px); border-radius: 50%;
  background: rgba(255, 255, 255, .22); transition: transform .3s var(--ease), background-color .3s;
}
.avt-dot:hover { background: rgba(255, 255, 255, .5); }
.avt-dot[aria-current="true"] { background: var(--dk); transform: scale(1.28); }

/* top control bar */
.avt-bar {
  position: absolute; inset: 3.4cqw 4.2cqw auto 4.2cqw; z-index: 7;
  display: flex; align-items: center; gap: 1.4cqw;
}
.avt-brand { display: inline-flex; align-items: center; gap: .9cqw; color: #fff; font-weight: 800; font-size: max(1.7cqw, 11px); letter-spacing: .01em; }
.avt-brand .ic { width: 2.2cqw; height: 2.2cqw; color: var(--dk); }
.avt-ctl { margin-left: auto; display: flex; align-items: center; gap: 1cqw; }
.avt-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: .7cqw;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: #fff;
  border-radius: 999px; padding: 0; width: 4.4cqw; height: 4.4cqw; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.avt-btn:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .4); }
.avt-btn:active { transform: scale(.96); }
.avt-btn .ic { width: 2.1cqw; height: 2.1cqw; }
.avt-btn-wide { width: auto; padding: 0 1.5cqw; height: 4.4cqw; font: inherit; font-size: 1.5cqw; font-weight: 700; }
.avt-btn-wide .ic { width: 1.7cqw; height: 1.7cqw; }

/* progress */
.avt-prog { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255, 255, 255, .1); z-index: 8; }
.avt-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--dk)); transform: scaleX(0); transform-origin: left; }

/* the moving cursor */
.avt-cur {
  position: absolute; left: 0; top: 0; z-index: 9; width: 2.4cqw; height: 2.4cqw; pointer-events: none;
  transform: translate3d(var(--cx, -12cqw), var(--cy, -12cqw), 0);
  transition: transform .85s cubic-bezier(.16, 1, .3, 1);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5));
}
.avt-cur svg { width: 100%; height: 100%; display: block; }
.avt-cur[data-click="1"] { animation: avb-click .5s var(--ease); }

/* chapter 1 pieces */
.avt-cnt { position: absolute; left: 4.2cqw; top: 12cqw; z-index: 5; display: flex; gap: 1.6cqw; flex-wrap: wrap; }
.avt-cnt div {
  background: rgba(11, 18, 32, .74); border: 1px solid rgba(255, 255, 255, .16); border-radius: 1.2cqw;
  padding: 1.2cqw 1.6cqw; min-width: 11cqw;
}
.avt-cnt b {
  display: block; font-family: 'JetBrains Mono', ui-monospace, monospace; color: #fff; font-size: max(3cqw, 13px);
  font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
.avt-cnt span { display: block; margin-top: .5cqw; color: #9db0cc; font-size: max(1.35cqw, 8px); font-weight: 600; }
.avt-box {
  position: absolute; z-index: 5; opacity: 0; transform: scale(.86);
  left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: calc(var(--w) * 1%); height: calc(var(--h) * 1%);
  transition: opacity .4s, transform .5s var(--ease);
}
.avt-box[data-in="1"] { opacity: 1; transform: none; }

/* chapter 2: event card */
.avt-card {
  position: absolute; right: 4.2cqw; top: 46%; z-index: 6; width: 34cqw;
  background: #fff; border-radius: 1.6cqw; box-shadow: 0 3cqw 6cqw -3cqw rgba(0, 0, 0, .7);
  transform: translate(120%, -50%); transition: transform .8s cubic-bezier(.16, 1, .3, 1), opacity .5s;
  opacity: 0; overflow: hidden;
}
.avt-card[data-in="1"] { transform: translate(0, -50%); opacity: 1; }
.avt-card .ph { position: relative; aspect-ratio: 16 / 9; background: #0b1220; }
.avt-card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avt-card .bd { padding: 2cqw; display: grid; gap: .8cqw; }
.avt-card .bd .r1 { display: flex; align-items: center; gap: 1cqw; }
.avt-card .bd .cls { font-size: max(2cqw, 11px); font-weight: 800; color: var(--ink); }
.avt-card .bd .tm { margin-left: auto; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: max(1.7cqw, 9px); color: var(--muted); font-variant-numeric: tabular-nums; }
.avt-card .bd .rw { display: flex; gap: 1cqw; flex-wrap: wrap; }
.avt-mini {
  display: inline-flex; align-items: center; gap: .6cqw; font-size: max(1.6cqw, 9px); font-weight: 700;
  border-radius: 999px; padding: .5cqw 1.2cqw; border: 1px solid;
}
.avt-mini .ic { width: 1.7cqw; height: 1.7cqw; }
.avt-mini-hi { color: #991b1b; background: #fef2f2; border-color: #f6d4d4; }
.avt-mini-ok { color: #14532d; background: #f0fdf4; border-color: #cde9d6; }
.avt-mini-acc { color: var(--accent-deep); background: var(--accent-tint); border-color: var(--accent-line); }

/* chapter 3: app window + model */
.avt-win {
  position: absolute; left: 50%; top: 40.5%; width: 56cqw; z-index: 5;
  transform: translate(-50%, -50%) scale(.86); opacity: 0; transition: transform .9s var(--ease), opacity .6s;
  background: #fff; border-radius: 1.8cqw; box-shadow: 0 4cqw 8cqw -4cqw rgba(0, 0, 0, .8); overflow: hidden;
}
.avt-win[data-in="1"] { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.avt-win .bar { display: flex; align-items: center; gap: 1cqw; padding: 1.2cqw 1.6cqw; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.avt-win .bar i { width: 1cqw; height: 1cqw; border-radius: 50%; background: #dfe6f0; }
.avt-win .bar u { flex: 1; height: 1.6cqw; border-radius: 999px; background: #f1f5fb; border: 1px solid var(--line); text-decoration: none; }
.avt-win .bd { display: grid; grid-template-columns: 1.02fr .98fr; gap: 1.8cqw; padding: 1.8cqw; align-items: stretch; }
.avt-win .shot { position: relative; border-radius: 1.2cqw; overflow: hidden; min-height: 26cqw; background: #0b1220; }
.avt-win .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avt-model { display: grid; gap: 1cqw; align-content: start; }
.avt-model .hd { font-size: 1.4cqw; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.avt-model .nm {
  display: inline-flex; align-items: center; gap: .8cqw; font-size: max(1.95cqw, 10px); font-weight: 800; color: var(--ink); white-space: nowrap;
  background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 1cqw; padding: 1cqw 1.4cqw;
}
.avt-model .nm .ic { width: 2cqw; height: 2cqw; color: var(--accent); }
.avt-cls { display: flex; flex-wrap: wrap; gap: .8cqw; }
.avt-cls span {
  font-size: max(1.5cqw, 8.5px); font-weight: 700; color: var(--ink-2); background: #f4f7fc; border: 1px solid var(--line);
  border-radius: 999px; padding: .5cqw 1.1cqw; opacity: 0; transform: translateY(.8cqw);
  transition: opacity .35s, transform .45s var(--ease);
}
.avt-cls span[data-in="1"] { opacity: 1; transform: none; }
.avt-check {
  display: flex; align-items: center; gap: 1cqw; margin-top: 1cqw; font-size: max(1.7cqw, 9px); font-weight: 700; color: #14532d;
  background: #f0fdf4; border: 1px solid #cde9d6; border-radius: 1cqw; padding: 1cqw 1.3cqw;
  opacity: 0; transform: translateY(.8cqw); transition: opacity .4s, transform .5s var(--ease);
}
.avt-check[data-in="1"] { opacity: 1; transform: none; }
.avt-check .ic { width: 2cqw; height: 2cqw; }

/* chapter 4: ask ai */
.avt-ask {
  position: absolute; left: 8cqw; right: 8cqw; top: 50%; z-index: 5; transform: translateY(-42%);
  background: #fff; border-radius: 1.8cqw; box-shadow: 0 3cqw 7cqw -3cqw rgba(0, 0, 0, .75);
  padding: 2.4cqw; opacity: 0; transition: opacity .5s, transform .7s var(--ease);
}
.avt-ask[data-in="1"] { opacity: 1; transform: translateY(-50%); }
.avt-ask .q { display: flex; align-items: center; gap: 1cqw; font-size: max(2.1cqw, 11px); color: var(--ink); min-height: 4cqw; }
.avt-ask .q .ic { width: 2.2cqw; height: 2.2cqw; color: var(--accent); }
.avt-ask .q .cur { display: inline-block; width: 2px; height: 2.2cqw; background: var(--accent); animation: avb-caret 1s steps(1, end) infinite; }
.avt-ask .a { margin-top: 1.6cqw; border-top: 1px solid var(--line); padding-top: 1.6cqw; display: grid; grid-template-columns: 1fr 26cqw; gap: 2cqw; align-items: start; }
.avt-ask .a p { margin: 0; font-size: max(1.75cqw, 10px); line-height: 1.55; color: var(--ink-2); }
.avt-bars2 { display: flex; align-items: flex-end; gap: 1cqw; height: 11cqw; }
.avt-bars2 b {
  flex: 1; height: 100%; border-radius: .5cqw .5cqw .2cqw .2cqw;
  background: linear-gradient(var(--accent), var(--accent-deep));
  transform: scaleY(0); transform-origin: bottom; transition: transform .55s var(--ease);
}
.avt-bars2 b[data-in="1"] { transform: scaleY(var(--h)); }

/* the small bar chart's caption: a chip, not a grey smudge, and clear of the bars */
.avt-barcap {
  display: block; width: max-content; max-width: 100%; margin: 1.6cqw auto 0; overflow: hidden; text-align: center;
  background: var(--accent-tint); color: var(--ink); border: 1px solid var(--accent-line);
  border-radius: 999px; padding: .45cqw 1.3cqw; font-size: max(1.28cqw, 8.5px); font-weight: 700;
  white-space: nowrap; letter-spacing: .01em;
}
.avt-barcap b { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--accent-deep); margin-right: .45cqw; }

/* chapter 5: rule fires */
.avt-rule {
  position: absolute; left: 7cqw; top: 20cqw; z-index: 5; width: 43cqw;
  background: rgba(11, 18, 32, .74); border: 1px solid rgba(255, 255, 255, .18); border-radius: 1.4cqw;
  padding: 1.8cqw; opacity: 0; transform: translateY(1.4cqw);
  transition: opacity .45s, transform .6s var(--ease);
}
.avt-rule[data-in="1"] { opacity: 1; transform: none; }
.avt-rule .t { display: flex; align-items: center; gap: 1cqw; color: #fff; font-size: max(1.9cqw, 10px); font-weight: 800; }
.avt-rule .t .ic { width: 2.1cqw; height: 2.1cqw; color: var(--dk); }
.avt-rule .s { margin-top: .8cqw; color: #a9bad6; font-size: max(1.55cqw, 9px); line-height: 1.5; }
.avt-rule .flow { display: flex; align-items: center; gap: 1cqw; margin-top: 1.4cqw; flex-wrap: wrap; }
.avt-flow {
  display: inline-flex; align-items: center; gap: .6cqw; font-size: max(1.45cqw, 8.5px); font-weight: 700;
  color: #dbe6f7; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px; padding: .5cqw 1.1cqw;
}
.avt-flow .ic { width: 1.6cqw; height: 1.6cqw; }
.avt-flow-on { color: #0b1220; background: var(--dk); border-color: var(--dk); }
.avt-toast {
  position: absolute; right: 4.2cqw; top: 19cqw; z-index: 7; width: 34cqw;
  background: #fff; border-radius: 1.5cqw; padding: 1.6cqw; box-shadow: 0 2cqw 5cqw -2cqw rgba(0, 0, 0, .7);
  transform: translate(130%, 0); opacity: 0; transition: transform .7s cubic-bezier(.16, 1, .3, 1), opacity .5s;
}
.avt-toast[data-in="1"] { transform: none; opacity: 1; }
.avt-toast .hd { display: flex; align-items: center; gap: .9cqw; font-size: max(1.55cqw, 9.5px); font-weight: 800; color: var(--ink); }
.avt-toast .hd .ic { width: 1.8cqw; height: 1.8cqw; color: var(--accent); }
.avt-toast .bd { margin-top: .7cqw; font-size: max(1.5cqw, 9px); color: var(--muted); line-height: 1.45; }
.avt-toast .rw { display: flex; gap: .8cqw; margin-top: 1.1cqw; }
.avt-bell {
  position: absolute; right: 13.4cqw; top: 4.4cqw; z-index: 7; width: 4.4cqw; height: 4.4cqw; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
}
.avt-bell .ic { width: 2.1cqw; height: 2.1cqw; color: #fff; transition: color .3s; }
.avt-bell[data-in="1"] { background: var(--dk); border-color: var(--dk); }
.avt-ch[data-ch="4"]::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url(/img/site/quarry-hero-960.webp) center/cover no-repeat; opacity: .22;
}
.avt-bell[data-in="1"] .ic { color: #0b1220; }

/* chapter 6: the resolve */
.avt-final { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; text-align: center; padding: 0 8cqw 10cqw; gap: 1.8cqw; }
.avt-final .sh { width: 9cqw; height: 9cqw; border-radius: 50%; display: grid; place-items: center; background: rgba(132, 204, 22, .14); border: 1px solid rgba(132, 204, 22, .45); }
.avt-final .sh .ic { width: 4.4cqw; height: 4.4cqw; color: var(--dk); }
.avt-final h3 { color: #fff; font-size: max(3cqw, 13px); line-height: 1.22; max-width: 64cqw; }
/* the last step already says its own title on screen, so the caption bar would only repeat it */
.avt-stage[data-chapter="5"] .avt-cap { opacity: 0; }
.avt-final p { margin: 0; color: #a9bad6; font-size: max(1.8cqw, 10px); max-width: 60cqw; line-height: 1.5; }
.avt-final .cta {
  display: inline-flex; align-items: center; gap: 1cqw; background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 800; font-size: max(1.8cqw, 10px); padding: 1.3cqw 2.6cqw; border-radius: 999px;
  box-shadow: 0 1.5cqw 3cqw -1.2cqw rgba(37, 87, 214, .9);
}
.avt-final .cta .ic { width: 1.9cqw; height: 1.9cqw; }
.avt-final .ln { color: #7f92b0; font-size: max(1.4cqw, 8.5px); letter-spacing: .04em; }

/* under the stage */
.avt-foot { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.avt-foot .progline { flex: 1; min-width: 120px; height: 4px; border-radius: 999px; background: var(--panel); overflow: hidden; }
.avt-foot .progline i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--dk)); transform: scaleX(0); transform-origin: left; }
.avt-foot .now { font-size: .82rem; font-weight: 700; color: var(--ink); min-width: 190px; }
.avt-foot .now span { color: var(--muted); font-weight: 600; }
.avt-kb { font-size: .78rem; color: var(--muted); }
.avt-kb kbd {
  font: inherit; font-size: .72rem; font-weight: 700; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px;
}

/* ============================================================ keyframes (transform / opacity only) */
@keyframes avb-breathe { from { transform: scale(1); opacity: .82; } to { transform: scale(1.014); opacity: 1; } }
@keyframes avb-scan { from { transform: translateY(-110%); } to { transform: translateY(430%); } }
@keyframes avb-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .25; } }
@keyframes avb-caret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes avb-slidein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes avb-click { 0% { transform: translate3d(var(--cx), var(--cy), 0) scale(1); } 40% { transform: translate3d(var(--cx), var(--cy), 0) scale(.82); } 100% { transform: translate3d(var(--cx), var(--cy), 0) scale(1); } }
@keyframes avb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.avbox-pulse { animation: avb-pulse 1.6s ease-in-out infinite, avb-breathe 3.6s ease-in-out infinite alternate; }

/* paused: every keyframe animation holds its current frame */
.avt-stage[data-paused="1"] *,
.avt-stage[data-paused="1"] .avbox { animation-play-state: paused !important; }

/* ============================================================ responsive */
@media (max-width: 900px) and (min-width: 561px) {
  .avb-gr { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .avb-kpis { grid-template-columns: repeat(2, 1fr); }
  .avb-cams { grid-template-columns: repeat(2, 1fr); }
  .avb-conf { grid-template-columns: 1fr; }
  .avb-an-foot { grid-template-columns: 1fr; }
  .avb-an-thumb { width: 120px; }
}
@media (max-width: 640px) {
  .avb-tile-name { font-size: .72rem; }
  .avb-tile .avbox .lb { font-size: .64rem; }
  /* phones: the stacked panels would make the frame four tiles tall, so swap the mechanism */
  .avbp { display: block; }
  .avbpanel { position: absolute; inset: 0; visibility: hidden; }
  .avbp { position: relative; min-height: 560px; }
  .avbpanel[data-on="1"] { position: relative; visibility: visible; }
  .avb-gr { grid-template-columns: 1fr; gap: 8px; }
  .avb-facts { grid-template-columns: 1fr 1fr; }
  .avbt { padding-right: 14px; }
  .avb-live-ctl .hint { display: none; }
  .avb-tl-r { display: none; }
  .avb-cams { grid-template-columns: 1fr; }
  .avbapp-hd { gap: 10px; padding: 10px 12px; }
  .avbapp-org { border: 0; padding: 0; font-size: .74rem; width: 100%; }
  .avbapp-chips { margin-left: 0; }
  .avb-row { grid-template-columns: 58px minmax(0, 1fr); }
  .avb-row .r { grid-column: 1 / -1; justify-content: flex-start; }
  .avb-row .ph { width: 58px; height: 34px; }
  /* on phones the step title already sits under the stage, so the in-stage caption would only collide */
  .avt-cap { display: none; }
  .avt-ask { left: 5cqw; right: 5cqw; }
  .avt-ask .a { grid-template-columns: 1fr 30cqw; gap: 1.4cqw; }
  .avt-foot .now { min-width: 0; }
}