/* Our work: "AI & systems", three live concept demos (ai-work.js): an AI SaaS workspace, a team of AI agents and an
   integration hub. Type and colour follow the page: Roboto Condensed 800 capitals, Inter, Consolas labels, cyan #8bdddf. */
.aiw { --aiw-cyan: #8bdddf; --aiw-blue: #6fb7ff; --aiw-ok: #6ee7a8; --aiw-amber: #f5c26b; --aiw-ink: #eff3f5; --aiw-text: #c7d3dc; --aiw-mute: #8193a3;
  position: relative; padding: clamp(80px, 9vw, 130px) 0 clamp(40px, 4vw, 60px); background: #05070a; color: var(--aiw-ink); }
.aiw::before { content: ""; position: absolute; inset: 0 0 auto; height: 520px; pointer-events: none;
  background: radial-gradient(ellipse 50% 70% at 70% 0%, rgb(70 150 255 / .10), transparent 70%); }
.aiw-shell { position: relative; width: calc(100% - 10vw); max-width: 1400px; margin-inline: auto; }

.aiw-head { display: grid; grid-template-columns: 1fr auto; gap: 18px 40px; align-items: end; margin-bottom: clamp(40px, 5vw, 72px); }
.aiw-kicker { grid-column: 1 / -1; margin: 0; font: 400 11px/1.2 Consolas, "Liberation Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--aiw-cyan); }
.aiw-head h2 { margin: 0; font: 800 clamp(40px, 4vw, 58px)/.9 "Roboto Condensed", "Arial Narrow", sans-serif; letter-spacing: -.03em; text-transform: uppercase; color: var(--aiw-ink); }
.aiw-head h2 span { color: var(--aiw-cyan); }
.aiw-meta { margin: 0; font: 400 11px/1.4 Consolas, "Liberation Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--aiw-cyan); text-align: right; }
.aiw-rel { grid-column: 1 / -1; max-width: 680px; margin: 4px 0 0; font: 400 15px/1.7 Inter, Arial, sans-serif; color: #a9bac4; }

.aiw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(64px, 8vw, 110px); }
.aiw-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: clamp(32px, 4vw, 64px); align-items: center; }
.aiw-text { max-width: 440px; }
.aiw-n { margin: 0 0 14px; font: 400 11px/1 Consolas, "Liberation Mono", monospace; letter-spacing: .14em; color: var(--aiw-cyan); }
.aiw-n span { color: var(--aiw-ink); }
.aiw-kind { margin: 0 0 12px; font: 400 11px/1.5 Consolas, "Liberation Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: #93a0b0; }
.aiw-text h3 { margin: 0 0 14px; font: 800 clamp(32px, 3.2vw, 46px)/.95 "Roboto Condensed", "Arial Narrow", sans-serif; letter-spacing: -.02em; text-transform: uppercase; color: var(--aiw-ink); }
.aiw-line { margin: 0 0 18px; font: 400 16px/1.65 Inter, Arial, sans-serif; color: var(--aiw-text); }
.aiw-rel a { color: var(--aiw-ink); text-decoration: none; border-bottom: 1px solid rgb(139 221 223 / .5); }
.aiw-rel a:hover, .aiw-rel a:focus-visible { color: var(--aiw-cyan); }
.aiw-try { margin: 0 0 10px; font: 400 10.5px/1 Consolas, "Liberation Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--aiw-amber); }
.aiw-tags { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; font: 500 14px/1.4 Inter, Arial, sans-serif; color: var(--aiw-ink); }
.aiw-tags li { display: flex; gap: 10px; align-items: baseline; }
.aiw-tags li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 1px; background: var(--aiw-blue); transform: translateY(-2px); box-shadow: 0 0 8px rgb(111 183 255 / .7); }
.aiw-actions { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; }
.aiw-go { display: inline-flex; gap: 10px; align-items: center; padding: 0 0 6px; font: 600 14px/1 Inter, Arial, sans-serif; color: var(--aiw-ink); text-decoration: none; border-bottom: 1px solid rgb(139 221 223 / .5); transition: border-color .25s, color .25s; }
.aiw-go:hover, .aiw-go:focus-visible { color: var(--aiw-cyan); border-color: var(--aiw-cyan); }
.aiw-ref { font: 400 11px/1.4 Consolas, "Liberation Mono", monospace; letter-spacing: .06em; color: #93a0b0; text-decoration: none; }
.aiw-ref b { color: var(--aiw-blue); font-weight: 700; }
.aiw-ref:hover b, .aiw-ref:focus-visible b { text-decoration: underline; }
.aiw-note { margin: 20px 0 0; font: 400 12px/1.5 Inter, Arial, sans-serif; color: var(--aiw-mute); }

/* ---- the app window ---- */
.aiw-screen { position: relative; container-type: inline-size; border: 1px solid rgb(139 221 223 / .16); border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #0c131c, #070c12); box-shadow: 0 50px 100px -50px rgb(0 0 0 / .9), 0 0 60px -20px rgb(70 150 255 / .18);
  font: 400 12px/1.4 Inter, Arial, sans-serif; color: var(--aiw-text); }
.aiw-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-bottom: 1px solid rgb(255 255 255 / .06); background: #0a1017; }
.aiw-bar > i { width: 8px; height: 8px; border-radius: 50%; background: #253140; }
.aiw-addr { margin-left: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 11px/1 Consolas, "Liberation Mono", monospace; color: #7d8d9c; }
.aiw-badge { margin-left: auto; flex: none; padding: 4px 7px; border: 1px solid rgb(245 194 107 / .35); border-radius: 4px; font: 400 9px/1 Consolas, "Liberation Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--aiw-amber); }
.aiw-pause { flex: none; padding: 4px 8px; border: 1px solid rgb(255 255 255 / .12); border-radius: 4px; background: transparent; font: 400 10px/1 Consolas, "Liberation Mono", monospace; letter-spacing: .08em; color: #a9bac4; cursor: pointer; }
.aiw-pause:hover, .aiw-pause:focus-visible { color: var(--aiw-ink); border-color: var(--aiw-cyan); }
.aiw-body { position: relative; aspect-ratio: 16 / 10; }
.aiw-screen[data-paused] *, .aiw-screen[data-paused] *::before, .aiw-screen[data-paused] *::after { animation-play-state: paused !important; }
.aiw-packet { position: absolute; z-index: 4; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none;
  background: #e6f9ff; box-shadow: 0 0 10px 3px rgb(111 200 255 / .85), 0 0 22px 6px rgb(60 140 255 / .35); }
.aiw-packet--ok { background: #eafff4; box-shadow: 0 0 10px 3px rgb(110 231 168 / .8); }

/* ---- 1. AI SaaS workspace ---- */
.saas { display: grid; grid-template-columns: 46px minmax(0, 1fr) 36%; }
.saas-side { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 0; border-right: 1px solid rgb(255 255 255 / .05); background: #080d13; }
.saas-side b { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--aiw-blue), #9b7bff); margin-bottom: 8px; }
.saas-side i { width: 16px; height: 16px; border-radius: 4px; background: #1a2430; }
.saas-side i.on { background: rgb(111 183 255 / .35); box-shadow: inset 0 0 0 1px var(--aiw-blue); }
.saas-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; }
.saas-head { display: flex; justify-content: space-between; align-items: baseline; }
.saas-head strong { font: 700 14px/1 Inter, Arial, sans-serif; color: var(--aiw-ink); }
.saas-head span { font: 400 10px/1 Consolas, monospace; color: var(--aiw-mute); }
.saas-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.saas-kpi { padding: 10px; border: 1px solid rgb(255 255 255 / .06); border-radius: 8px; background: #0d151f; transition: border-color .4s, box-shadow .4s; }
.saas-kpi small { display: block; font-size: 10px; color: var(--aiw-mute); }
.saas-kpi b { display: block; margin: 4px 0 2px; font: 700 17px/1.1 Inter, Arial, sans-serif; color: var(--aiw-ink); }
.saas-kpi em { font: normal 600 10px/1 Inter, Arial, sans-serif; }
.saas-kpi em.up { color: var(--aiw-ok); } .saas-kpi em.down { color: var(--aiw-ok); }
.saas-kpi.is-hot { border-color: rgb(111 183 255 / .7); box-shadow: 0 0 0 1px rgb(111 183 255 / .4), 0 0 24px -4px rgb(111 183 255 / .55); }
.saas-chart { position: relative; flex: 1; min-height: 0; padding: 10px 10px 22px; border: 1px solid rgb(255 255 255 / .06); border-radius: 8px; background: #0b121b; }
.saas-chart svg { width: 100%; height: 100%; display: block; overflow: visible; clip-path: inset(-10px 100% -10px 0); transition: clip-path 1.6s cubic-bezier(.4, 0, .2, 1); }
.saas-chart.is-drawn svg { clip-path: inset(-10px -10px -10px 0); }
.saas-chart .grid line { stroke: rgb(255 255 255 / .05); stroke-width: 1; vector-effect: non-scaling-stroke; }
.saas-chart .area { fill: url(#aiw-area); }
.saas-chart .line { fill: none; stroke: var(--aiw-blue); stroke-width: 2; vector-effect: non-scaling-stroke; }
.saas-chart .fc { fill: none; stroke: #b79bff; stroke-width: 2; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .8s ease; }
.saas-chart .fc-band { fill: rgb(183 155 255 / .12); opacity: 0; transition: opacity .8s ease; }
.saas-chart.show-fc .fc, .saas-chart.show-fc .fc-band { opacity: 1; }
.saas-legend { position: absolute; left: 12px; bottom: 6px; display: flex; gap: 14px; font: 400 9px/1 Consolas, monospace; color: var(--aiw-mute); }
.saas-legend span::before { content: ""; display: inline-block; width: 10px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--aiw-blue); }
.saas-legend span.fc::before { background: repeating-linear-gradient(90deg, #b79bff 0 3px, transparent 3px 5px); }
.saas-ai { display: flex; flex-direction: column; min-width: 0; padding: 14px; border-left: 1px solid rgb(255 255 255 / .06); background: linear-gradient(180deg, #0b1220, #08101a); }
.saas-ai-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 700 12px/1 Inter, Arial, sans-serif; color: var(--aiw-ink); }
.saas-ai-h .dot { width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle, #e9f6ff, var(--aiw-blue)); box-shadow: 0 0 10px var(--aiw-blue); animation: aiw-blink 2.4s ease-in-out infinite; }
@keyframes aiw-blink { 50% { opacity: .45; } }
.saas-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; }
.saas-msg { max-width: 92%; padding: 8px 10px; border-radius: 10px; font-size: 11.5px; line-height: 1.5; }
.saas-msg.me { align-self: flex-end; background: #1a2a3c; color: var(--aiw-ink); border-bottom-right-radius: 3px; }
.saas-msg.ai { align-self: flex-start; background: #0f1a28; border: 1px solid rgb(111 183 255 / .22); color: var(--aiw-text); border-bottom-left-radius: 3px; }
.saas-typing { display: inline-flex; gap: 3px; } .saas-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--aiw-blue); animation: aiw-dots 1s infinite; }
.saas-typing i:nth-child(2) { animation-delay: .15s; } .saas-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiw-dots { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.saas-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.saas-chips button { padding: 6px 9px; border: 1px solid rgb(111 183 255 / .3); border-radius: 999px; background: rgb(111 183 255 / .06); font: 500 10.5px/1 Inter, Arial, sans-serif; color: #cfe6ff; cursor: pointer; transition: background .2s, border-color .2s; }
.saas-chips button:hover:not(:disabled), .saas-chips button:focus-visible { background: rgb(111 183 255 / .16); border-color: var(--aiw-blue); }
.saas-chips button:disabled { opacity: .45; cursor: default; }

/* ---- 2. AI agents ---- */
.agents { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 36%; }
.ag-graph { position: relative; min-height: 0; background: radial-gradient(circle at 50% 50%, rgb(255 255 255 / .03) 1px, transparent 1.5px) 0 0 / 18px 18px; }
.ag-wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.ag-wires path { fill: none; stroke: rgb(139 221 223 / .16); stroke-width: 1.4; vector-effect: non-scaling-stroke; transition: stroke .4s; }
.ag-wires path.is-lit { stroke: rgb(139 221 223 / .55); }
.ag-node { position: absolute; z-index: 2; width: 15.5%; min-width: 86px; padding: 7px 9px 8px; transform: translate(-50%, -50%); border: 1px solid rgb(139 221 223 / .18); border-radius: 8px; background: #0e1722; transition: border-color .35s, box-shadow .35s, background .35s; }
.ag-node small { display: block; font: 400 8.5px/1.3 Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--aiw-mute); }
.ag-node b { display: block; margin-top: 3px; font: 700 11.5px/1.25 Inter, Arial, sans-serif; color: var(--aiw-ink); }
.ag-node::after { content: ""; position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #2a3746; }
.ag-node.is-active { border-color: var(--aiw-cyan); background: #0f1d29; box-shadow: 0 0 0 3px rgb(139 221 223 / .12), 0 0 26px -4px rgb(139 221 223 / .6); }
.ag-node.is-active::after { background: var(--aiw-cyan); animation: aiw-blink .8s ease-in-out infinite; }
.ag-node.is-done { border-color: rgb(110 231 168 / .45); }
.ag-node.is-done::after { background: var(--aiw-ok); box-shadow: 0 0 8px var(--aiw-ok); }
.ag-node.is-wait { border-color: var(--aiw-amber); box-shadow: 0 0 0 3px rgb(245 194 107 / .12), 0 0 26px -4px rgb(245 194 107 / .55); }
.ag-node.is-wait::after { background: var(--aiw-amber); animation: aiw-blink .8s ease-in-out infinite; }
.ag-approve { display: none; margin-top: 6px; padding: 4px 8px; border: 0; border-radius: 4px; background: var(--aiw-amber); font: 700 10px/1 Inter, Arial, sans-serif; color: #1a1406; cursor: pointer; }
.ag-node.is-wait .ag-approve { display: inline-block; }
.ag-log { display: flex; flex-direction: column; min-height: 0; padding: 10px 14px 12px; border-top: 1px solid rgb(255 255 255 / .06); background: #060a0f; font: 400 10.5px/1.6 Consolas, "Liberation Mono", monospace; }
.ag-log-h { display: flex; justify-content: space-between; margin: 0 0 6px; color: var(--aiw-mute); letter-spacing: .08em; text-transform: uppercase; font-size: 9.5px; }
.ag-state { color: var(--aiw-cyan); } .ag-state.is-done { color: var(--aiw-ok); } .ag-state.is-wait { color: var(--aiw-amber); }
.ag-log ol { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.ag-log li { display: flex; gap: 10px; min-width: 0; white-space: nowrap; animation: aiw-line .35s ease-out; }
.ag-log li span { min-width: 0; }
.ag-log li time { color: #4f6070; } .ag-log li b { width: 64px; flex: none; font-weight: 400; color: var(--aiw-cyan); }
.ag-log li span { overflow: hidden; text-overflow: ellipsis; color: var(--aiw-text); }
.ag-log li.is-ok b, .ag-log li.is-ok span { color: var(--aiw-ok); } .ag-log li.is-wait b, .ag-log li.is-wait span { color: var(--aiw-amber); }
@keyframes aiw-line { from { opacity: 0; transform: translateY(4px); } }

/* ---- 3. Integration hub ---- */
.hub { display: grid; grid-template-columns: minmax(0, 1fr) 38%; }
.hub-map { position: relative; min-height: 0; }
.hub-wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub-wires line { stroke: rgb(139 221 223 / .14); stroke-width: 1.3; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; transition: stroke .35s; }
.hub-wires line.is-lit { stroke: rgb(139 221 223 / .6); }
.hub-core { position: absolute; z-index: 2; left: 50%; top: 50%; width: 24%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-content: center; text-align: center; border-radius: 50%;
  border: 1px solid rgb(111 183 255 / .45); background: radial-gradient(circle at 50% 40%, #13243a, #0a121c 70%); box-shadow: 0 0 40px -6px rgb(70 150 255 / .5); }
.hub-core::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 1px solid rgb(111 183 255 / .25); animation: aiw-ring 3s ease-out infinite; }
@keyframes aiw-ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.hub-core.is-pulse { box-shadow: 0 0 0 4px rgb(111 183 255 / .2), 0 0 60px rgb(70 150 255 / .75); }
.hub-core b { font: 800 13px/1.1 "Roboto Condensed", "Arial Narrow", sans-serif; letter-spacing: .02em; text-transform: uppercase; color: var(--aiw-ink); }
.hub-core small { margin-top: 3px; font: 400 8.5px/1.3 Consolas, monospace; color: var(--aiw-mute); }
.hub-node { position: absolute; z-index: 2; transform: translate(-50%, -50%); padding: 7px 10px; border: 1px solid rgb(139 221 223 / .2); border-radius: 7px; background: #0e1722; font: 600 11px/1.2 Inter, Arial, sans-serif; color: var(--aiw-ink); white-space: nowrap; cursor: pointer; transition: border-color .3s, box-shadow .3s, background .3s; }
.hub-node small { display: block; margin-top: 2px; font: 400 8.5px/1.2 Consolas, monospace; color: var(--aiw-mute); }
.hub-node:hover, .hub-node:focus-visible { border-color: var(--aiw-cyan); outline: none; }
.hub-node.is-src { border-color: var(--aiw-blue); background: #102035; box-shadow: 0 0 24px -4px rgb(111 183 255 / .7); }
.hub-node.is-hit { border-color: var(--aiw-ok); box-shadow: 0 0 22px -4px rgb(110 231 168 / .7); }
.hub-panel { display: flex; flex-direction: column; min-width: 0; padding: 14px; border-left: 1px solid rgb(255 255 255 / .06); background: #060a0f; }
.hub-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; font: 400 9.5px/1 Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--aiw-mute); }
.hub-ev { padding: 3px 6px; border-radius: 4px; background: rgb(111 183 255 / .12); color: #cfe6ff; letter-spacing: 0; text-transform: none; font-size: 10.5px; }
.hub-json { margin: 0 0 10px; padding: 10px; border: 1px solid rgb(255 255 255 / .06); border-radius: 6px; background: #0a1017; font: 400 10.5px/1.55 Consolas, "Liberation Mono", monospace; color: #8a9aab; white-space: pre; overflow: hidden; }
.hub-json .k { color: #9fd3ff; } .hub-json .s { color: #b9f0c9; } .hub-json .n { color: #f5c26b; }
.hub-del { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; overflow: hidden; font: 400 10.5px/1.35 Inter, Arial, sans-serif; }
.hub-del li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; animation: aiw-line .3s ease-out; }
.hub-del li::before { content: "✓"; color: var(--aiw-ok); font-size: 10px; }
.hub-del li b { font-weight: 600; color: var(--aiw-ink); } .hub-del li b + span { color: var(--aiw-text); }
.hub-del li em { font: normal 400 9.5px/1 Consolas, monospace; color: var(--aiw-ok); }
.hub-count { margin-top: 8px; font: 400 9.5px/1 Consolas, monospace; color: var(--aiw-mute); }
.hub-count b { color: var(--aiw-ink); font-weight: 400; }

/* ---- narrow windows (the window's own width) ---- */
@container (max-width: 600px) {
  .aiw-body { aspect-ratio: auto; }
  .saas { grid-template-columns: minmax(0, 1fr); }
  .saas-side { display: none; }
  .saas-main { height: 300px; padding: 12px; }
  .saas-ai { height: 270px; border-left: 0; border-top: 1px solid rgb(255 255 255 / .06); }
  .saas-kpi b { font-size: 14px; }
  .agents { grid-template-rows: 420px 210px; }
  .ag-node { width: 34%; min-width: 0; padding: 6px 8px 7px; }
  .ag-node b { font-size: 11px; }
  .ag-log li b { width: 56px; }
  .hub { grid-template-columns: minmax(0, 1fr); }
  .hub-map { height: 330px; }
  .hub-core { width: 30%; }
  .hub-node { padding: 6px 8px; font-size: 10px; }
  .hub-node small { display: none; }
  .hub-panel { height: 270px; border-left: 0; border-top: 1px solid rgb(255 255 255 / .06); }
  .hub-del li { grid-template-columns: auto auto 1fr auto; }
  .hub-del li b + span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .aiw-addr { display: none; }
}

@media (max-width: 1099px) {
  .aiw-row { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .aiw-text { max-width: 620px; }
  .aiw-head { grid-template-columns: 1fr; }
  .aiw-meta { text-align: left; }
}
@media (max-width: 600px) {
  .aiw-shell { width: calc(100% - 40px); }
}
@media (prefers-reduced-motion: reduce) {
  .ag-log li, .hub-del li { animation: none; }
  .saas-chart svg { transition: none; }
}
