/*
 * AuditBook guided tour — a narrated walkthrough of the real app screens.
 * Everything is scoped under .abt so it can sit inside the home page's dialog
 * or fill tour.html on its own. Colours fall back to the site's tokens.
 * Stage: the real AuditBook screen in a phone or laptop, zooming to what the
 * voice names; captions underneath; chapter cards to hear one feature.
 */
.abt {
  --abt-ink: var(--ink, #0b2a5b);
  --abt-sub: var(--muted, #4a5d80);
  --abt-card: var(--card, #ffffff);
  --abt-line: var(--line, #dde6f5);
  --abt-blue: #1e5bd8;
  --abt-sky: #5aa0ff;
  color: var(--abt-ink);
  font-size: 16px;
  line-height: 1.55;
}
.abt *, .abt *::before, .abt *::after { box-sizing: border-box; min-width: 0; }

/* Stage */
.abt-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 70% 35%, #ffffff 0%, #eaf1ff 45%, #cfdffb 100%); box-shadow: 0 20px 60px rgba(11, 42, 91, .2); }
.abt-stage::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(rgba(30, 91, 216, .04) 1px, transparent 1px) 0 0 / 60px 60px, linear-gradient(90deg, rgba(30, 91, 216, .04) 1px, transparent 1px) 0 0 / 60px 60px; }
.abt-live { position: absolute; left: 18px; top: 16px; z-index: 2; display: flex; gap: 6px; align-items: center; background: rgba(11, 42, 91, .8); color: #fff;
  font: 600 13px Inter, system-ui, sans-serif; padding: 5px 11px; border-radius: 99px; opacity: 0; transition: opacity .3s; }
.abt-live.on { opacity: 1; }
.abt-live i { width: 8px; height: 8px; border-radius: 50%; background: #ff5a5a; animation: abt-blink 1s infinite; }
@keyframes abt-blink { 50% { opacity: .3; } }

.abt-dev { position: absolute; transition: opacity .45s, transform .6s cubic-bezier(.2, .8, .2, 1); }
.abt-dev.off { opacity: 0; transform: translateY(24px) scale(.97); pointer-events: none; }
/* Phone: 84% of the stage's height, centred (its width as a share of a 16:9 stage). */
.abt-phone { left: 50%; top: 4%; height: 84%; aspect-ratio: 1000 / 2150; margin-left: calc(84% * 1000 / 2150 * -0.5 * 9 / 16);
  padding: 1.1%; background: #141822; border-radius: 9% / 4.2%; box-shadow: 0 24px 50px rgba(11, 42, 91, .33), inset 0 0 0 2px #5a6478; }
.abt-laptop { left: 16%; top: 6%; width: 68%; }
.abt-lid { background: #161a24; padding: 1.6% 1.6% 1.4%; border-radius: 14px 14px 4px 4px; box-shadow: 0 24px 50px rgba(11, 42, 91, .3); }
.abt-base { height: 14px; margin: 0 -6%; background: linear-gradient(#e6eaf2, #b9c0ce); border-radius: 0 0 14px 14px; }
.abt-vp { position: relative; overflow: hidden; width: 100%; height: 100%; border-radius: inherit; background: #fff; }
.abt-phone .abt-vp { border-radius: 8% / 3.8%; }
.abt-laptop .abt-vp { aspect-ratio: 2049 / 1200; border-radius: 3px; }
.abt-zoom { position: absolute; inset: 0; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.abt-zoom img { width: 100%; height: 100%; display: block; }
.abt-hl { position: absolute; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--abt-sky), 0 0 26px 6px rgba(90, 160, 255, .7);
  opacity: 0; transition: all .6s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.abt-hl.on { opacity: 1; animation: abt-pulse 1.6s ease-in-out infinite; }
@keyframes abt-pulse { 50% { box-shadow: 0 0 0 3px var(--abt-sky), 0 0 40px 12px rgba(90, 160, 255, .56); } }

.abt-cap { position: absolute; left: 4%; right: 4%; bottom: 3.5%; text-align: center; pointer-events: none; }
.abt-cap span { display: inline; background: rgba(11, 42, 91, .85); color: #fff; font: 500 clamp(13px, 1.7vw, 19px)/1.6 Inter, system-ui, sans-serif;
  padding: 4px 12px; border-radius: 8px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.abt-cap span:empty { display: none; }
.abt-cap b { color: #9cc5ff; font-weight: 600; }
.abt-cap.hide { display: none; }

.abt-start { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(11, 42, 91, .35); border: 0; cursor: pointer;
  color: #fff; font: 600 18px var(--head, 'Manrope', Inter, sans-serif); }
.abt-start > span { display: grid; justify-items: center; gap: 12px; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.abt-start em { width: 96px; height: 96px; border-radius: 50%; background: var(--abt-blue); display: grid; place-items: center; box-shadow: 0 0 0 12px rgba(255, 255, 255, .25); }
.abt-start em::after { content: ""; border-left: 30px solid #fff; border-top: 18px solid transparent; border-bottom: 18px solid transparent; margin-left: 8px; }
.abt-start[hidden] { display: none; }

/* Controls */
.abt-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 8px; }
.abt button, .abt select { font: 600 15px Inter, system-ui, sans-serif; color: var(--abt-ink); background: var(--abt-card); border: 1px solid var(--abt-line);
  border-radius: 12px; min-height: 44px; padding: 0 16px; cursor: pointer; }
.abt button.abt-start { background: rgba(11, 42, 91, .35); border: 0; border-radius: 0; color: #fff; font-size: 18px; }
.abt button:focus-visible, .abt select:focus-visible { outline: 3px solid var(--abt-sky); outline-offset: 2px; }
.abt .abt-primary { background: var(--abt-blue); color: #fff; border-color: var(--abt-blue); min-width: 104px; }
.abt-grow { flex: 1; }
.abt-prog { height: 6px; border-radius: 9px; background: var(--abt-line); overflow: hidden; margin-bottom: 14px; }
.abt-prog i { display: block; height: 100%; width: 0; background: var(--abt-blue); transition: width .4s; }
.abt-note { font-size: 14px; color: var(--abt-sub); margin: 0 0 18px; }
.abt-h { font: 700 20px/1.2 var(--head, 'Manrope', Inter, sans-serif); margin: 6px 0 12px; color: var(--abt-ink); }

/* Chapters */
.abt-chs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.abt .abt-ch { text-align: left; padding: 14px 16px; min-height: auto; display: grid; gap: 4px; border-radius: 16px; font-weight: 400; }
.abt-ch strong { font: 700 16px var(--head, 'Manrope', Inter, sans-serif); }
.abt-ch small { color: var(--abt-sub); font-size: 14px; line-height: 1.4; }
.abt .abt-ch.cur { border-color: var(--abt-blue); box-shadow: 0 0 0 2px var(--abt-blue); }

@media (max-width: 700px) {
  .abt-stage { aspect-ratio: 3 / 4; }
  .abt-phone { top: 5%; height: 76%; margin-left: calc(76% * 1000 / 2150 * -0.5 * 4 / 3); }
  .abt-laptop { left: 4%; width: 92%; top: 22%; }
  .abt-bar .abt-grow { flex-basis: 100%; height: 0; }
  .abt-bar select { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .abt-zoom, .abt-dev, .abt-hl { transition: none; }
  .abt-hl.on, .abt-live i { animation: none; }
}
