/* The AI agents' characters and their little films — shared by the app and the public site (the site sets the
   colour variables on its .ag-scope). */
@property --ai-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ai-rot { to { --ai-a: 360deg; } }
@keyframes ai-caret { 50% { opacity: 0; } }
@keyframes ai-row-in { from { opacity: 0; transform: translateY(6px); } }

/* living characters: blink, look at the pointer, wink, cheer up on hover, look up while they work */
.agent-face.live { display: inline-block; flex: none; line-height: 0; border-radius: 0; }
.agent-face.live svg { width: 100%; height: 100%; display: block; overflow: visible; transform-origin: 50% 85%;
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.agent-face.live .eyes { transition: transform .18s ease-out; }
.agent-face.live .eye { transform-box: fill-box; transform-origin: 50% 55%; transition: transform .07s ease-in; }
.agent-face.live.blink .eye, .agent-face.live.wink .eye:last-child { transform: scaleY(.08); }
.agent-face.live.happy svg { transform: scale(1.08, .96) translateY(-1px); }
.agent-face.live.wink svg { transform: rotate(-6deg) scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  .agent-face.live svg, .agent-face.live .eyes, .agent-face.live .eye { transition: none; }
}

.tour-wrap { display: flex; flex-direction: column; }
.agent-tour { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); min-height: 470px; }
.tour-text { display: flex; flex-direction: column; gap: 16px; padding: 28px 28px 22px; animation: ai-row-in .35s cubic-bezier(.2, .8, .3, 1); }
.tour-who { display: flex; align-items: center; gap: 14px; }
.tour-who h2 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.tour-who span { font-size: 13px; color: var(--text-3); }
.tour-pitch { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--text); font-weight: 500; }
.tour-block h4 { margin: 0 0 7px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.tour-block p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.tour-block ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.tour-block li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.tour-block li .icon { flex: none; margin-top: 3px; color: #16a34a; }
.tour-example { display: flex; flex-direction: column; gap: 6px; }
.tour-before, .tour-after { padding: 9px 12px; border-radius: 10px; }
.tour-before { background: var(--surface-2); }
.tour-after { background: linear-gradient(135deg, color-mix(in srgb, #8b5cf6 9%, var(--surface)), color-mix(in srgb, var(--accent) 9%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); }
.tour-before span, .tour-after span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.tour-after span { color: var(--accent); }
.tour-before p { color: var(--text-2); font-style: italic; }
.tour-after p { color: var(--text); }
.tour-foot { margin-top: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.tour-price { font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tour-demo { position: relative; display: grid; place-items: center; padding: 28px 24px; border-left: 1px solid var(--border);
  background: radial-gradient(120% 80% at 80% 0%, color-mix(in srgb, #8b5cf6 14%, transparent), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--surface-2); }
.tour-switch { display: flex; justify-content: center; gap: 6px; padding: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.tour-switch button { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid transparent; border-radius: 50%; background: transparent; cursor: pointer;
  opacity: .55; transition: opacity .15s, border-color .15s, transform .15s; }
.tour-switch button:hover { opacity: 1; transform: translateY(-1px); }
.tour-switch button.on { opacity: 1; border-color: var(--accent); }

/* the mock window */
.demo-win { position: relative; width: 100%; max-width: 440px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 24px 50px -20px rgba(15, 23, 42, .4); overflow: hidden; transition: opacity .4s; }
.demo-win.fade { opacity: 0; }
.demo-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.demo-bar i { width: 9px; height: 9px; border-radius: 50%; background: #f87171; } .demo-bar i:nth-child(2) { background: #fbbf24; } .demo-bar i:nth-child(3) { background: #34d399; }
.demo-bar span { margin-left: 8px; font-size: 11px; color: var(--text-3); font-weight: 600; }
.demo-screen { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 330px; padding: 16px; font-size: 12.5px; color: var(--text); }
.demo-screen > *, .demo-list > *, .demo-thread > *, .demo-team > *, .demo-pop > * { opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s cubic-bezier(.2, .8, .3, 1); }
.demo-screen .in, .demo-list .in, .demo-thread .in, .demo-team .in, .demo-pop .in, .demo-card .in, .demo-field .in { opacity: 1; transform: none; }
.demo-pointer { position: absolute; left: 0; top: 0; z-index: 5; opacity: 0; transform: translate(380px, 300px); transition: transform .65s cubic-bezier(.45, 0, .2, 1), opacity .3s;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); pointer-events: none; }
.demo-pointer.show { opacity: 1; }
.demo-pointer svg { display: block; transition: transform .12s; }
.demo-pointer.down svg { transform: scale(.82); }
.demo-btn { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; height: 26px; padding: 0 10px 0 5px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--surface); color: var(--accent); transition: transform .12s, background .2s; }
.demo-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); padding: 0 12px; }
.demo-btn.pressed { transform: scale(.93); background: var(--accent-soft); }
.demo-row { display: flex; gap: 6px; }
.demo-muted { color: var(--text-3); font-size: 11.5px; }
.demo-field { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; transition: box-shadow .3s; }
.demo-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.demo-input { min-height: 36px; padding-right: 28px; font-size: 13px; line-height: 1.45; }
.demo-mark { position: absolute; right: 8px; top: 30px; opacity: 0; transition: opacity .3s; }
.demo-mark.in { opacity: 1; }
.demo-field.flash { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--accent-soft); }
.demo-busy { position: relative; }
.demo-busy::after { content: ''; position: absolute; inset: -3px; border-radius: 12px; pointer-events: none; padding: 1.5px;
  background: conic-gradient(from var(--ai-a), var(--accent), #8b5cf6, #ec4899, #f59e0b, #22d3ee, var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ai-rot 1.6s linear infinite; }
.demo-pop { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--surface); box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .35); }
.demo-pop > *, .demo-pop.in > * { opacity: 1; transform: none; }
.demo-pop small, .demo-mail small { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); font-weight: 600; }
.demo-pop b { font-size: 13px; }
.demo-sum { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; animation: ai-row-in .4s cubic-bezier(.2, .8, .3, 1) backwards; }
.demo-sum span { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 700; background: #dcfce7; color: #16a34a; }
.demo-sum.open span { background: #fef3c7; color: #b45309; }
.demo-sum.next span { background: var(--accent-soft); color: var(--accent); }
.demo-sum.warn span { background: #fee2e2; color: #dc2626; }
.demo-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.demo-card b { font-size: 13.5px; }
.demo-list, .demo-thread, .demo-team { display: flex; flex-direction: column; gap: 6px; position: relative; transition: opacity .3s; }
.demo-item, .demo-task { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.demo-item > span:nth-child(2), .demo-task > span:nth-child(2) { flex: 1; }
.demo-check { width: 16px; height: 16px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--border-strong, var(--border)); border-radius: 50%; font-size: 10px; font-weight: 700; }
.demo-check.done { background: #16a34a; border-color: #16a34a; }
.demo-item.today { border-color: color-mix(in srgb, #14b8a6 50%, var(--border)); background: color-mix(in srgb, #14b8a6 7%, var(--surface)); }
.demo-item.today .demo-check { background: linear-gradient(135deg, #14b8a6, #0ea5e9); border: 0; color: #fff; }
.demo-item.moved { opacity: .6; }
.demo-chip { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.demo-chip.late { background: #fee2e2; color: #dc2626; }
.demo-chip.moved { background: var(--accent-soft); color: var(--accent); }
.demo-ava { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; }
.demo-msg { display: flex; gap: 8px; align-items: flex-start; }
.demo-msg > div { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 4px 10px 10px 10px; background: var(--surface-2); }
.demo-msg b { font-size: 11px; }
.demo-thread.dim, .demo-team.dim, .demo-chart.dim { opacity: .35; }
.demo-voice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 999px; background: var(--surface-2); }
.demo-play { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #fb7185, #f59e0b); color: #fff; font-size: 10px; }
.demo-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 24px; }
.demo-wave i { flex: 1; height: 30%; border-radius: 2px; background: color-mix(in srgb, #fb7185 70%, transparent); }
.demo-voice.playing .demo-wave i { animation: demo-wave .56s ease-in-out infinite alternate; }
@keyframes demo-wave { to { height: 100%; } }
.demo-transcript { margin: 0; font-style: italic; color: var(--text-2); min-height: 36px; line-height: 1.45; }
.demo-chart { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; transition: opacity .3s; }
.demo-chart i { flex: 1; height: 0; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #8b5cf6, var(--accent)); transition: height .8s cubic-bezier(.2, .8, .3, 1); }
.demo-chart.in i { height: var(--h); }
.demo-person { display: flex; align-items: center; gap: 8px; }
.demo-person > span:nth-child(2) { width: 52px; }
.demo-bar-mini { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.demo-bar-mini i { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #ef4444); border-radius: 3px; }
.demo-team.scan::before { content: ''; position: absolute; inset: 0; border-radius: 8px; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, #8b5cf6 22%, transparent), transparent); background-size: 100% 60%; background-repeat: no-repeat;
  animation: demo-scan 1s linear infinite; }
@keyframes demo-scan { from { background-position: 0 -60%; } to { background-position: 0 160%; } }
.demo-mini { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.demo-mail { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, #ec4899 30%, var(--border)); background: var(--surface); }
.demo-mail p { margin: 0; min-height: 54px; line-height: 1.5; }
.typing::after { content: ''; display: inline-block; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--accent); animation: ai-caret .7s steps(1) infinite; }

@media (max-width: 820px) {
  .agent-tour { grid-template-columns: 1fr; }
  .tour-demo { order: -1; border-left: 0; border-bottom: 1px solid var(--border); padding: 50px 14px 20px; }
  .tour-text { padding: 20px 18px; }
  .demo-screen { min-height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-screen > *, .demo-list > *, .demo-thread > *, .demo-team > *, .demo-pop > *, .demo-pointer, .demo-chart i { transition: none; }
  .demo-sum, .tour-text, .demo-wave i, .demo-busy::after, .demo-team.scan::before { animation: none; }
}

/* an agent's first appearance: it runs in from the left in little hops, lands with a squash and settles */
.agent-face.live.arrive svg { animation: agent-arrive 1.25s cubic-bezier(.3, .7, .3, 1) both; transform-origin: 50% 90%; }
.agent-face.live.arrive .eyes { transform: translate(5px, -1px); }
@keyframes agent-arrive {
  0% { transform: translateX(calc(var(--run) * -1)) scale(.85); opacity: 0; }
  12% { opacity: 1; }
  22% { transform: translateX(calc(var(--run) * -.72)) translateY(-22%) rotate(8deg); }
  36% { transform: translateX(calc(var(--run) * -.48)) translateY(0) scale(1.06, .9) rotate(4deg); }
  50% { transform: translateX(calc(var(--run) * -.26)) translateY(-16%) rotate(6deg); }
  64% { transform: translateX(calc(var(--run) * -.06)) translateY(0) scale(1.14, .84); }
  76% { transform: translateX(2%) translateY(-7%) scale(.94, 1.07) rotate(-4deg); }
  88% { transform: translateY(0) scale(1.04, .97); }
  100% { transform: none; opacity: 1; }
}

/* the little films of the construction agents */
.demo-shots { display: flex; gap: 6px; }
.demo-shots i { width: 54px; height: 40px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.demo-photo { position: relative; height: 130px; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, #d6d3d1, #a8a29e 60%, #78716c); }
.demo-crack { position: absolute; left: 20%; top: 18%; width: 60%; height: 64%;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60'%3E%3Cpath d='M2 30 18 26 26 34 40 22 52 30 64 18 78 28 98 20' fill='none' stroke='%23292524' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M40 22 44 10M64 18 70 36' fill='none' stroke='%23292524' stroke-width='1.4'/%3E%3C/svg%3E"); }
.demo-photo.scan::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(132, 204, 22, .35), transparent); background-size: 100% 40%;
  background-repeat: no-repeat; animation: demo-scan 1s linear infinite; }
.demo-pop.flash { box-shadow: 0 0 0 2px #84cc16, 0 10px 24px -12px rgba(15, 23, 42, .35); transition: box-shadow .3s; }
.demo-gantt { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.demo-gantt-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; font-size: 11.5px; }
.demo-gantt-track { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); }
.demo-gantt-track i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #c2410c, #f59e0b); animation: demo-grow .6s cubic-bezier(.2, .8, .3, 1) backwards; transform-origin: left; }
@keyframes demo-grow { from { transform: scaleX(0); } }

/* the little films */
.demo-doc { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; border-radius: 8px; background: #fff; color: #111827;
  border: 1px solid #e5e7eb; box-shadow: 0 6px 16px -10px rgba(15, 23, 42, .35); overflow: hidden; }
.demo-doc b { font-size: 12px; letter-spacing: .06em; }
.demo-doc i { display: block; height: 6px; border-radius: 3px; background: #e5e7eb; }
.demo-doc i.short { width: 55%; }
.demo-doc span { align-self: flex-end; font-weight: 700; font-size: 13px; }
.demo-doc .demo-sign { align-self: flex-start; font-weight: 500; font-size: 11.5px; color: #6b7280; }
.demo-doc.scan::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .3), transparent); background-size: 100% 40%;
  background-repeat: no-repeat; animation: demo-scan 1s linear infinite; }
.demo-transcript.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal; font-size: 11px; white-space: pre-line; }
.demo-gantt-track i.neg { background: linear-gradient(90deg, #f87171, #dc2626); }
.demo-gantt-track i.pos { background: linear-gradient(90deg, #4ade80, #16a34a); }
@media (prefers-reduced-motion: reduce) { .demo-doc.scan::after { animation: none; } }
@media (prefers-reduced-motion: reduce) { .demo-gantt-track i, .demo-photo.scan::after { animation: none; } }
.demo-tech { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.5; color: var(--text-2); }
