/* Features: Ask Xomea (#ask-xomea in features.dc.html, 20 November 2026). The four
   language-model tools the AI cards do not cover, as a bento: the Assistant and Draft
   with AI take wide cards, Ticket Recaps and Spend caps narrow ones, zig-zagging across
   two rows. Each card opens with an instrument plate in the AI cards' frame (.ai-plate,
   css/features-ai-cards.css): a mono top bar whose status follows the scene, and the
   tool at work. Plates lay themselves out by their own width (container queries), so
   the same scene works wide, narrow and on a phone. Each tool takes one colour family
   as --hue: the Assistant teal, recaps blue, Draft with AI violet (the models family),
   spend caps brass; amber marks a spent cap. js/features-ask.js plays the scenes,
   cycles their examples on a slow tour, lets the pointer take over, and moves a soft
   light under it. The markup at rest is the finished picture, so without the script,
   or with motion paused, nothing is hidden and nothing moves. Illustrative content. */

.ask-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 14px; background: var(--line); overflow: hidden; }
.ask-card[data-ask='assistant'] { grid-column: 1 / 3; grid-row: 1; }
.ask-card[data-ask='recap'] { grid-column: 3; grid-row: 1; }
.ask-card[data-ask='draft'] { grid-column: 2 / 4; grid-row: 2; }
.ask-card[data-ask='caps'] { grid-column: 1; grid-row: 2; }
.ask-card { --hue: var(--accent); --hue-wash: var(--teal-wash); --hue-line: var(--teal-line); --mx: 50%; --my: 0%; position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0; padding: 20px; background: var(--bg); }
.ask-card--blue { --hue: var(--stage-blue); --hue-wash: var(--blue-wash); --hue-line: var(--blue-line); }
.ask-card--violet { --hue: var(--stage-violet); --hue-wash: var(--violet-wash); --hue-line: var(--violet-line); }
.ask-card--brass { --hue: var(--brass); --hue-wash: var(--brass-wash); --hue-line: var(--brass-line); }
/* The light under the pointer, in the card's own colour */
.ask-card::after { position: absolute; inset: 0; z-index: -1; background: radial-gradient(300px circle at var(--mx) var(--my), color-mix(in srgb, var(--hue) 9%, transparent), transparent 70%); opacity: 0; transition: opacity .4s ease; content: ''; pointer-events: none; }
.ask-card:hover::after { opacity: 1; }
/* The line that crosses the top of a card as its scene plays */
.ask-card::before { position: absolute; inset: 0 0 auto; height: 2px; background: var(--hue); transform: scaleX(0); transform-origin: left; content: ''; pointer-events: none; }

/* Card type follows the page: the title is a .v2-card-title (20px, 18-20px on phones)
   with the site's card icon (20px, 8px gap, as on Architecture), set on the first line
   when a narrow card wraps it; the copy is read in full, so 14px as in the AI cards.
   Spacing: 20px of space on every side of the plate (the card edges and the title),
   12px title to copy, 20px under the copy. */
.ask-title { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-family: var(--f-sans); color: var(--text); text-wrap: balance; }
.ask-title > span { min-width: 0; }
.ask-icon { width: 20px; height: 20px; margin-top: calc((1.2em - 20px) / 2); color: var(--hue); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.ask-text { max-width: 62ch; margin: 0; font: 400 14px/1.55 var(--f-sans); color: var(--muted); text-wrap: pretty; }

/* The plate: the AI cards' frame (and its 20px foot), taller, lit from one corner in
   the card's colour, and brighter while its scene plays. Inside, sentences, notes and
   word labels are Geist 12px; Geist Mono is kept for counts, figures and ticket
   numbers (11px) and the tracked capitals of a label. */
.ask-plate { height: 184px; container: ask / inline-size; transition: border-color .5s ease, box-shadow .6s ease; }
.ask-plate[hidden] { display: none; }
.ask-plate::before { position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--hue) 14%, transparent), transparent 60%); content: ''; pointer-events: none; }
.ask-card:hover .ask-plate { border-color: var(--hue-line); }
.ask-card.is-live .ask-plate { border-color: var(--hue-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hue) 8%, transparent), 0 14px 34px -16px color-mix(in srgb, var(--hue) 50%, transparent); }
.ask-card .ai-plate__top { position: relative; }
.ask-card .ai-plate__top > :first-child::before { background: var(--hue); }
.ask-status { color: var(--hue); transition: color .3s ease; }
.ask-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; font: 400 12px/1.4 var(--f-sans); color: var(--text); }
.ask-stage p, .ask-stage ul { margin: 0; }

/* Assistant: the question, what it read to answer, then the answer, word by word */
.ask-chat { display: grid; align-content: center; gap: 8px; }
.ask-convo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ask-compose { display: none; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; padding: 5px 6px 5px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--faint); }
.ask-compose svg { width: 18px; height: 18px; padding: 3px; border-radius: 5px; background: var(--hue-wash); fill: none; stroke: var(--hue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ask-q { align-self: flex-end; max-width: 100%; padding: 5px 10px; border-radius: 9px 9px 2px 9px; background: var(--hue-wash); }
.ask-typed { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ask-a { align-self: flex-start; display: flex; align-items: flex-start; gap: 8px; max-width: 100%; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 9px 9px 9px 2px; background: var(--bg); color: var(--muted); }
.ask-a b { color: var(--text); font-weight: 500; }
.ask-mark { flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--hue); color: var(--bg); font: 500 11px/1 var(--f-sans); }
/* What it read: a tracked mono label, then each source as a chip with its name in
   Geist and its count in mono (the AI cards' field rows: name, then value) */
.ask-read { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--faint); }
.ask-read__k { font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.ask-read ul { display: contents; list-style: none; padding: 0; }
.ask-read li { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; line-height: 1; color: var(--muted); }
.ask-read li b { font: 500 11px/1 var(--f-mono); color: var(--hue); font-variant-numeric: tabular-nums; }
@container ask (min-width: 460px) {
  .ask-chat { grid-template-columns: minmax(0, 1fr) 156px; gap: 16px; align-items: center; }
  .ask-convo { width: min(100%, 440px); justify-self: center; }
  .ask-compose { display: flex; }
  .ask-read { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; padding-left: 16px; border-left: 1px solid var(--line); }
  .ask-read__k { margin-bottom: 2px; }
  .ask-read li { justify-content: space-between; padding: 5px 8px; }
}

/* Recap: the ticket (or "Now", for a briefing), then three lines streaming in */
.ask-k { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: var(--muted); }
.ask-k b { flex: none; font: 500 11px/1 var(--f-mono); color: var(--hue); font-variant-numeric: tabular-nums; }
.ask-k span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ask-lines { list-style: none; padding: 0; display: grid; gap: 4px; }
.ask-lines li { position: relative; padding-left: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.ask-lines li::before { position: absolute; left: 0; top: 3px; bottom: 3px; width: 2px; border-radius: 1px; background: var(--hue-line); content: ''; }
.ask-lines li:first-child { color: var(--text); }
.ask-lines li:first-child::before { background: var(--hue); }
.ask-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--faint); }
.ask-meta::before { width: 5px; height: 5px; border-radius: 1px; background: var(--hue); content: ''; }

/* Draft with AI: the description, the wand, then the form's fields filling with their
   ticks; the assignee stays for a person. Three layouts by the plate's width, so no
   value is ever cut short: narrow plates stack the description over four of the six
   fields; from 460px all six sit in two columns under it; from 640px the description
   stands beside them. A field column needs 208px (the 52px label, the 128px chip of
   the longest example value, Access and identity, and the tick): change these widths
   with the examples in js/features-ask.js. */
.ask-draft { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.ask-desc { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--muted); }
.ask-desc .ask-typed { flex: 1; min-width: 0; }
.ask-wand { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--hue-wash); color: var(--hue); }
.ask-wand svg, .ask-arrow { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ask-wand svg { width: 13px; height: 13px; }
.ask-arrow { display: none; width: 16px; height: 16px; color: var(--hue); }
.ask-fields { display: grid; gap: 4px; }
.ask-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 12px; align-items: center; gap: 8px; }
.ask-row span { color: var(--faint); }
.ask-row b { overflow: hidden; padding: 1px 8px; border: 1px solid var(--hue-line); border-radius: 5px; background: var(--hue-wash); font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.ask-row svg { width: 12px; height: 12px; fill: none; stroke: var(--hue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ask-row--left b { border-style: dashed; border-color: var(--line-2); background: transparent; color: var(--muted); font-weight: 400; }
.ask-row--extra { display: none; }
@container ask (min-width: 460px) {
  .ask-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .ask-row--extra { display: grid; }
}
@container ask (min-width: 640px) {
  .ask-draft { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(428px, 2.6fr); align-items: center; gap: 12px; }
  .ask-desc { align-items: flex-start; padding: 8px 6px 8px 10px; }
  .ask-desc .ask-typed { white-space: normal; }
  .ask-arrow { display: block; }
}

/* Spend caps: the day's share as a figure, two scaled meters, and where they stop.
   A spent day turns amber. */
.ask-big { display: flex; align-items: baseline; gap: 8px; color: var(--muted); }
.ask-big b { font: 500 20px/1 var(--f-sans); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.ask-meter { display: grid; grid-template-columns: 40px minmax(0, 1fr) 34px; align-items: center; gap: 8px; }
.ask-meter span { color: var(--faint); }
.ask-meter b { font: 500 11px/1 var(--f-mono); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.ask-meter i { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), color-mix(in srgb, var(--text) 18%, transparent) calc(25% - 1px) 25%), color-mix(in srgb, var(--text) 9%, transparent); }
.ask-meter i::after { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--hue-line), var(--hue)); box-shadow: 0 0 8px color-mix(in srgb, var(--hue) 45%, transparent); transform: scaleX(var(--v)); transform-origin: left; content: ''; }
.ask-stop { display: flex; align-items: center; gap: 8px; color: var(--faint); transition: color .3s ease; }
.ask-stop::before { width: 5px; height: 5px; border-radius: 1px; background: var(--hue); content: ''; }
.ask-card.is-warn :is(.ask-status, .ask-stop) { color: var(--warn); }
.ask-card.is-warn .ask-stop::before { background: var(--warn); }
.ask-card.is-warn .ask-meter[data-m='day'] i::after { background: linear-gradient(90deg, var(--warn-line), var(--warn)); box-shadow: 0 0 8px color-mix(in srgb, var(--warn) 50%, transparent); }

/* Playback. Armed (set by the script while motion is allowed), each part waits hidden
   until its card plays; .is-on plays a card's scene and leaves it finished. */
#ask-xomea.ask-armed .ask-card:not(.is-on) :is(.ask-q, .ask-a, .ask-k, .ask-lines li, .ask-meta, .ask-desc, .ask-row b, .ask-row svg, .ask-big, .ask-stop) { opacity: 0; }
#ask-xomea.ask-armed .ask-card:not(.is-on) .ask-read li { opacity: .25; }
#ask-xomea.ask-armed .ask-card:not(.is-on) .ask-meter i::after { transform: scaleX(0); }
.ask-card.is-on::before { animation: ask-sweep 1.8s cubic-bezier(.4, 0, .2, 1) both; }
.ask-card.is-on .ask-icon { animation: ask-nod .7s cubic-bezier(.2, .8, .2, 1) both; }
/* Assistant */
.ask-card.is-on .ask-q { animation: ask-rise .35s ease both; }
.ask-card.is-on .ask-q .ask-typed { animation: ask-type .85s steps(34, end) .1s both; }
.ask-card.is-on .ask-read li { animation: ask-light .4s ease both; animation-delay: calc(.95s + var(--i, 0) * 170ms); }
.ask-card.is-on .ask-a { animation: ask-rise .4s cubic-bezier(.2, .8, .2, 1) 1.45s both; }
.ask-card.is-on .ask-a .w { animation: ask-word .3s ease both; animation-delay: calc(1.55s + var(--i, 0) * 60ms); }
/* Recap */
.ask-card.is-on .ask-k { animation: ask-rise .35s ease both; }
.ask-card.is-on .ask-lines li { animation: ask-stream .5s cubic-bezier(.2, .8, .2, 1) .2s both; }
.ask-card.is-on .ask-lines li:nth-child(2) { animation-delay: .55s; }
.ask-card.is-on .ask-lines li:nth-child(3) { animation-delay: .9s; }
.ask-card.is-on .ask-meta { animation: ask-rise .4s ease 1.25s both; }
/* Draft with AI */
.ask-card.is-on .ask-desc { animation: ask-rise .35s ease both; }
.ask-card.is-on .ask-desc .ask-typed { animation: ask-type .8s steps(40, end) .1s both; }
.ask-card.is-on .ask-wand { animation: ask-press .55s ease .95s both; }
.ask-card.is-on .ask-arrow { animation: ask-nudge .5s ease 1.05s both; }
.ask-card.is-on .ask-row b { animation: ask-fill .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(1.15s + var(--n, 0) * 120ms); }
.ask-card.is-on .ask-row svg { animation: ask-tick .3s ease both; animation-delay: calc(1.4s + var(--n, 0) * 120ms); }
/* Impact and urgency appear only on wider plates. If a plate widens after its scene has
   played (a window resized, a tablet turned), they show filled at once rather than
   replaying their fill from blank. */
.ask-card:not(.is-live) .ask-row--extra :is(b, svg) { animation: none; }
/* Spend caps */
.ask-card.is-on .ask-big { animation: ask-rise .4s ease both; }
.ask-card.is-on .ask-meter i::after { animation: ask-meter 1.1s cubic-bezier(.3, 0, .2, 1) .15s both; }
.ask-card.is-on .ask-meter[data-m='month'] i::after { animation-delay: .35s; }
.ask-card.is-on .ask-stop { animation: ask-rise .45s ease 1.1s both; }
@media (hover: hover) {
  .ask-card:hover .ask-icon { transform: translateY(-2px); }
}
@keyframes ask-sweep { 0% { transform: scaleX(0); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes ask-nod { 40% { transform: translateY(-3px) rotate(-6deg); } }
@keyframes ask-rise { from { opacity: 0; transform: translateY(5px); } }
@keyframes ask-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ask-light { from { opacity: .25; } 55% { border-color: var(--hue-line); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hue) 14%, transparent); } }
@keyframes ask-word { from { opacity: 0; filter: blur(3px); } }
@keyframes ask-stream { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes ask-press { 40% { transform: scale(.82); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hue) 22%, transparent); } }
@keyframes ask-nudge { 50% { transform: translateX(3px); } }
@keyframes ask-fill { from { opacity: 0; transform: translateX(-6px); } }
@keyframes ask-tick { from { opacity: 0; transform: scale(.4); } }
@keyframes ask-meter { from { transform: scaleX(0); } }
html.xomea-motion-paused #ask-xomea *, html.xomea-motion-paused #ask-xomea *::before, html.xomea-motion-paused #ask-xomea *::after { animation: none !important; }

/* Two columns: the Assistant and Draft with AI full width, recaps and caps side by side */
@media (max-width: 1040px) {
  .ask-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ask-card[data-ask='assistant'] { grid-column: 1 / 3; grid-row: 1; }
  .ask-card[data-ask='recap'] { grid-column: 1; grid-row: 2; }
  .ask-card[data-ask='caps'] { grid-column: 2; grid-row: 2; }
  .ask-card[data-ask='draft'] { grid-column: 1 / 3; grid-row: 3; }
}
@media (max-width: 560px) {
  .ask-grid { grid-template-columns: minmax(0, 1fr); }
  .ask-card[data-ask] { grid-column: auto; grid-row: auto; }
}
