/* Homepage demo: the hero's live triage panel, the learning board and the search
   playground. The console follows the page's own tokens, so light mode is a paper
   console on the same artwork. Loaded by index.html and index.dc.html; behaviour
   is in js/home-demo.js. */
.demo-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Headline: "learns" carries a confidence bar, with the same 60% threshold mark as the
   demo's bars. It fills once, in step with the first suggestion. */
.demo-learns { position: relative; }
.demo-learns__bar { position: absolute; left: .03em; right: .02em; bottom: -.04em; height: .055em; border-radius: 99px; background: color-mix(in srgb, currentColor 22%, transparent); }
.demo-learns__bar::after { content: ''; position: absolute; left: 60%; top: -.07em; bottom: -.07em; width: 1px; background: currentColor; opacity: .55; }
.demo-learns__bar b { position: absolute; inset: 0; border-radius: inherit; background: currentColor; transform: scaleX(0); transform-origin: left; }

/* Hero stage: the same box as the artwork it replaces. Light mode keeps that
   picture and turns the console (chrome, cards, type) onto the page's paper. */
main .hero__stage.demo-stage { display: flex; flex-direction: column; container: demostage / inline-size; background: #000; }
/* Light mode keeps the page radius and no stroke. The frame is flat, so the
   radius alone rounds it. */
[data-theme='light'] .home-page .hero__stage.demo-stage {
  color-scheme: light; color: var(--text); background-color: transparent; border-width: 0; box-shadow: 0 22px 40px -28px rgb(46 36 22 / .35); filter: none;
}
.demo-stage > .demo-tri, .demo-stage > .demo-steps { position: relative; z-index: 1; }

/* Artwork: about 240 KB of AVIF (WebP fallback) instead of the 12.4 MB PNG.
   The same picture in both themes. Sharp while the panel is empty; blurred once
   the email lands (.is-busy). Dark lays a black veil over that blur; light lays a
   paper wash over it, so the stage joins the page while the cards are up. */
.demo-art { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* The poster is a 24 x 32 copy of the art (under 1 KB, inline), so the stage is never an empty box.
   It is blurred, or its pixels show, and overhangs the frame so the blur has no pale edge. */
.demo-art::before { content: ''; position: absolute; inset: -28px; background: url("data:image/webp;base64,UklGRrQCAABXRUJQVlA4WAoAAAAgAAAAFwAAHwAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZWUDggxgAAABAGAJ0BKhgAIAA+pUCbSaYjoqE3+qgAwBSJZwDLMbJexmf3tainmSxDooUfa64AbPjVa4n9+EqxYAD+9ET4yhui4Qm26tB+JH3MvmalsLlqMP3VGL9Iw88DJKY8xhW7v5L6LrhnE93AFmNlqIdLMaXHcPirSXdo8HjiqIJIOfa2nnE06QZE/kgGfI/H/JUlKtkCzJS7ksKAE2zmh+Xnzj4GbMps0N0prDOA0vbQTJlDj1cn23gw/QQHOO6gSij+rGHZIpTAAA==") center top / cover no-repeat; filter: blur(14px); }
/* The art is rarely decoded in time for the page's first frame, and used to snap in a few
   frames later. The page's head script marks it pending, so the stage shows the poster
   until js/home-demo.js has the art decoded; then the art fades in over it, and its
   glow with it. The head script clears the mark after 6s regardless. */
html.xomea-art-pending .demo-art img { opacity: 0; }
/* An <img decoding="sync"> in the markup rather than a CSS background: Chrome draws a
   page before decoding a large background, so the art used to land a few frames late. */
.demo-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.demo-art img { scale: 1.05; transition: opacity .9s cubic-bezier(.2, .8, .2, 1), filter 1.8s cubic-bezier(.65, 0, .35, 1), scale 2.6s cubic-bezier(.65, 0, .35, 1); }
/* The wash carries a vignette, so the edges darken as the cards come up */
.demo-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 90% 80% at 50% 42%, transparent 45%, rgb(0 0 0 / .5) 100%), linear-gradient(180deg, rgb(12 11 10 / .6), rgb(12 11 10 / .78) 55%, rgb(12 11 10 / .9)); opacity: .15; transition: opacity 1.8s cubic-bezier(.65, 0, .35, 1); }
/* Fine, still film grain over the artwork; it also breaks up banding in the blur */
.demo-grain { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>"); }
.demo-stage.is-busy .demo-art img { filter: blur(14px) saturate(1.1); scale: 1.1; }
.demo-stage.is-busy .demo-art::after { opacity: 1; }
/* Light fades the picture towards the page's paper instead of towards black. The
   blurred art still tints the wash, lifted and saturated so that tint reads as
   colour rather than grey. At rest the wash is off, so the sharp art is untouched. */
[data-theme='light'] .demo-art::after {
  background: linear-gradient(180deg, rgb(247 244 238 / .8), rgb(243 240 233 / .84) 55%, rgb(238 235 227 / .9));
  opacity: 0;
}
[data-theme='light'] .demo-stage.is-busy .demo-art::after { opacity: 1; }
[data-theme='light'] .demo-stage.is-busy .demo-art img { filter: blur(14px) saturate(1.7) brightness(1.5); }

/* Ambient light round the hero film (22 November 2026): the film paints a small canvas from its own light
   (js/home-film.js ambient) and it is scaled up behind the stage, so the page round the stage takes each
   chapter's colour, the cuts and the SLA warning. It was a blurred copy of the earlier hero artwork, a
   249 KB picture the page no longer shows. Its gradients are soft at that size, so it needs no blur. */
.demo-ambient { display: none; }
@media (min-width: 961px) {
  .demo-ambient { display: block; grid-column: 2; grid-row: 1 / 3; align-self: start; position: relative; z-index: 0; aspect-ratio: 1904 / 2544; margin-block: 28px; pointer-events: none; opacity: .5; transform: scale(1.32); }
  .demo-ambient canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  /* On paper the same glow is a softer halo, so it doesn't read as a soot stain. */
  [data-theme='light'] .demo-ambient { opacity: .26; }
}

/* Light: a canvas particle system draws the flare on the planet, the flight and
   the landing burst. Screen blending adds its light to the artwork beneath. */
.demo-sky { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.demo-light { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; }
/* Screen blend adds light to the picture. Once the paper cards are up it would
   vanish on them, so the landing bloom paints normally instead. */
[data-theme='light'] .demo-stage.is-busy .demo-light { mix-blend-mode: normal; }

/* Triage panel. Base styles are the empty first frame; the script animates
   each element in, and .is-final is the still frame shown when motion is off. */
.demo-tri { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.demo-tri__top { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 12px; color: var(--muted); }
.demo-tri__top b { font-weight: 500; color: var(--text); }
.demo-local { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.demo-local i { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px rgb(var(--signal-rgb) / .18); }
.demo-tri__body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; padding: 18px; }

.demo-mail, .demo-ticket { background: color-mix(in srgb, var(--raise) 70%, transparent); }
/* Cards lift off the art: a soft drop shadow and a 1 px glass edge along the top.
   The script uses the same shadow when it adds a glow, so the two never fight. */
.demo-mail, .demo-ticket, .demo-toast, .demo-trend { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 40px -20px rgba(0, 0, 0, .75); }
/* The ticket is the subject, so it sits higher than the cards around it.
   Matches cardShadow(true) in js/home-demo.js. */
.demo-ticket { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 4px rgba(0, 0, 0, .3), 0 28px 56px -18px rgba(0, 0, 0, .9); }
/* The email steps back from its lower edge, so it stays joined to the connector */
.demo-mail { transform-origin: 50% 100%; }
.demo-mail { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 2px 12px; padding: 13px 14px; border: 1px solid var(--line-2); border-radius: 10px; opacity: 0; }
.demo-avatar { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--text) 12%, var(--raise)); font-size: 12px; font-weight: 600; line-height: 1; text-align: center; color: var(--text); }
.demo-mail__from { font-size: 13px; font-weight: 500; color: var(--text); }
.demo-mail__from span { margin-left: 6px; font-weight: 400; color: var(--faint); }
.demo-mail__time { font: 400 11px/1.8 var(--mono); color: var(--faint); }
.demo-mail__subj { grid-column: 2 / 4; font-size: 13px; line-height: 1.45; color: var(--muted); }

.demo-link { display: flex; align-items: center; gap: 12px; height: 28px; padding-left: 30px; font: 400 11px/1 var(--mono); color: var(--faint); }
.demo-link i { width: 1px; height: 100%; background: linear-gradient(var(--signal), rgb(var(--signal-rgb) / .15)); transform: scaleY(0); transform-origin: top; }
.demo-link span { opacity: 0; }

.demo-ticket { position: relative; overflow: hidden; padding: 14px 14px 12px; border: 1px solid var(--line-2); border-radius: 10px; opacity: 0; transition: border-color .8s cubic-bezier(.65, 0, .35, 1); }
.demo-scan { position: absolute; inset: 0; pointer-events: none; translate: -101% 0; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .06) 47%, rgb(var(--signal-rgb) / .09) 53%, transparent 70%); }
.demo-ticket__head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.demo-ticket__id { flex: none; font: 400 11px/1 var(--mono); color: var(--faint); }
.demo-ticket__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--text); }

/* Labels that change when the agent applies. Both share one grid cell, so the size never
   jumps; the old label leaves upwards before the new one rises in, so they never overlap. */
.demo-state, .demo-apply { position: relative; display: inline-grid; place-items: center; overflow: hidden; }
.demo-state > span, .demo-apply > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 6px; transition: opacity .2s cubic-bezier(.4, 0, 1, 1), transform .2s cubic-bezier(.4, 0, 1, 1); }
.demo-state .after, .demo-apply .after { opacity: 0; transform: translateY(70%); }
.demo-tri.is-applied .demo-state .before, .demo-tri.is-applied .demo-apply .before { opacity: 0; transform: translateY(-70%); }
.demo-tri.is-applied .demo-state .after, .demo-tri.is-applied .demo-apply .after { opacity: 1; transform: none; transition: opacity .34s cubic-bezier(.16, 1, .3, 1) .18s, transform .34s cubic-bezier(.16, 1, .3, 1) .18s; }
.demo-check { flex: none; }
.demo-check path { stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .45s cubic-bezier(.65, 0, .35, 1) .38s; }
.demo-tri.is-applied .demo-check path { stroke-dashoffset: 0; }
/* The press: a soft ink ripple from the cursor tip, inside the button */
.demo-apply__ink { position: absolute; left: 0; top: 0; width: 180px; height: 180px; margin: -90px 0 0 -90px; border-radius: 50%; background: rgb(255 255 255 / .4); opacity: 0; pointer-events: none; }
.demo-state { margin-left: auto; flex: none; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 11px; color: var(--muted); transition: color .6s, border-color .6s; }
.demo-tri.is-applied .demo-state { color: var(--signal); border-color: rgb(var(--signal-rgb) / .45); }
.demo-tri.is-applied .demo-ticket { border-color: rgb(var(--signal-rgb) / .5); }

.demo-fields { list-style: none; margin: 12px 0 0; padding: 0; }
.demo-frow { display: grid; grid-template-columns: 70px minmax(0, 1fr) 96px 34px; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.demo-frow .k { font-size: 12px; color: var(--faint); }
.demo-frow .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); opacity: 0; }
.demo-frow.is-low .v { color: var(--muted); }
.demo-bar { position: relative; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.demo-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--c) * 1%); border-radius: inherit; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: background-color .8s cubic-bezier(.65, 0, .35, 1); }
.demo-frow.is-failed .demo-bar i { background: color-mix(in srgb, var(--text) 30%, transparent); }
.demo-bar b { position: absolute; left: 60%; top: -4px; bottom: -4px; width: 1px; background: var(--muted); opacity: .6; transition: opacity .4s, background-color .4s; }
/* The threshold names itself once, on the row that stops short of it (THRESHOLD in js/home-demo.js) */
.demo-bar b::after { content: 'needs 60%'; position: absolute; left: 50%; bottom: 100%; translate: -50% 3px; font: 400 9px/1 var(--mono); white-space: nowrap; color: var(--muted); opacity: 0; transition: opacity .5s, translate .5s cubic-bezier(.16, 1, .3, 1); }
.demo-frow:is(.is-short, .is-failed) .demo-bar b { opacity: 1; background: var(--text); }
.demo-frow:is(.is-short, .is-failed) .demo-bar b::after { opacity: 1; translate: -50% 0; }
.demo-pct { font: 400 11px/1 var(--mono); text-align: right; color: var(--faint); transition: color .4s; }
.demo-frow.is-live .demo-pct, .demo-tri.is-final .demo-pct { color: var(--muted); }
.demo-frow.is-failed .demo-pct { color: var(--faint); }

.demo-ticket__foot { display: flex; align-items: center; gap: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.demo-learned { margin-right: auto; max-width: 32ch; font-size: 11px; line-height: 1.45; color: var(--faint); }
/* Three states: a quiet outline while the model reads, solid signal once the
   suggestions are ready, then the tinted "Applied" label. */
.demo-apply { flex: none; min-width: 142px; padding: 8px 11px; border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1; transition: background-color .6s, border-color .6s, color .6s; }
.demo-tri.is-ready .demo-apply { border-color: var(--signal); background: var(--signal); color: var(--bg); }
.demo-tri.is-applied .demo-apply { border-color: transparent; background: rgb(var(--signal-rgb) / .14); color: var(--signal); }

.demo-toast { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid rgb(var(--signal-rgb) / .3); border-radius: 10px; background: color-mix(in srgb, rgb(var(--signal-rgb)) 9%, color-mix(in srgb, var(--surface) 70%, transparent)); font-size: 12px; color: var(--text); opacity: 0; }
.demo-toast svg { flex: none; color: var(--signal); }

.demo-trend { display: grid; grid-template-columns: minmax(0, 1fr) 128px; align-items: center; gap: 16px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: color-mix(in srgb, var(--surface) 60%, transparent); opacity: 0; }
.demo-trend b { display: block; font-size: 20px; font-weight: 500; line-height: 1.1; letter-spacing: -.02em; color: var(--text); }
.demo-trend span { display: block; margin-top: 3px; font-size: 11px; line-height: 1.45; color: var(--faint); }
.demo-trend svg { width: 100%; height: 40px; overflow: visible; }
.demo-trend polyline { fill: none; stroke: var(--signal); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.demo-trend .area { fill: rgb(var(--signal-rgb) / .1); }

.demo-cursor { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; opacity: 0; offset-anchor: 1px 1px; offset-rotate: 0deg; transform-origin: 1px 1px; filter: drop-shadow(0 2px 4px rgb(0 0 0 / .45)); }

/* Still final frame: reduced motion, the site's Pause motion, or the demo's own Pause */
.demo-tri.is-final .demo-mail, .demo-tri.is-final .demo-ticket, .demo-tri.is-final .demo-toast, .demo-tri.is-final .demo-trend,
.demo-tri.is-final .demo-frow .v, .demo-tri.is-final .demo-link span, .demo-tri.is-final .demo-apply { opacity: 1; }
.demo-tri.is-final .demo-link i, .demo-tri.is-final .demo-bar i { transform: none; }
/* Same receded email as the moving demo (RECEDED in js/home-demo.js) */
.demo-tri.is-final .demo-mail { opacity: .8; scale: .975; }

/* Bottom strip, styled like the stage controls it replaces */
.demo-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.demo-step { position: relative; min-height: 52px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 5px; font: 400 11px/1.2 var(--mono); color: var(--faint); transition: color .6s, background-color .6s; }
.demo-step + .demo-step, .demo-pause { border-left: 1px solid var(--line); }
.demo-step b { font: 500 12px/1 var(--sans); color: var(--muted); transition: color .6s; }
.demo-step.is-active { color: var(--muted); background: rgb(var(--signal-rgb) / .06); }
/* Each step's line fills over that step's duration; finished steps keep it, dimmed */
.demo-step__bar { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: opacity .6s; }
.demo-step.is-done .demo-step__bar { opacity: .35; }
.demo-stage.is-still .demo-step__bar { transform: none; }
.demo-step.is-active b { color: var(--text); }
.demo-pause { display: grid; place-items: center; width: 52px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--muted); }
.demo-pause svg { width: 15px; height: 15px; fill: currentColor; }
.demo-pause .demo-pause__play { display: none; }
.demo-pause.is-paused .demo-pause__pause { display: none; }
.demo-pause.is-paused .demo-pause__play { display: block; }
.demo-pause:hover { color: var(--accent); }

/* Light console. The bars stay square and the frame's radius clips them.
   The picture stays clear of that curve, or it shows through as a dark line.
   Cards are a lit paper shade with no stroke. The shadow matches cardShadow()
   in js/home-demo.js. The connector sits on the paper wash, so it uses page ink. */
[data-theme='light'] .demo-art { clip-path: inset(22px 0 22px 0); }
[data-theme='light'] .demo-tri__top { background: linear-gradient(180deg, rgb(255 255 255 / .98), rgb(236 231 222 / .94)); }
[data-theme='light'] .demo-steps { background: linear-gradient(180deg, rgb(248 245 239 / .96), rgb(236 231 222 / .98)); }
[data-theme='light'] :is(.demo-mail, .demo-ticket, .demo-toast, .demo-trend) { border-width: 0; }
[data-theme='light'] .demo-mail,
[data-theme='light'] .demo-ticket { background: linear-gradient(180deg, #fff 0%, #fbf9f5 58%, #f6f3ec 100%); }
[data-theme='light'] .demo-trend { background: linear-gradient(180deg, #fffdfa 0%, #f6f3ec 100%); }
[data-theme='light'] .demo-toast { background: linear-gradient(180deg, #fffdfa 0%, #eaf3ee 100%); }
[data-theme='light'] :is(.demo-mail, .demo-ticket, .demo-toast, .demo-trend) {
  box-shadow: 0 1px 2px rgb(20 16 8 / .14), 0 18px 34px -16px rgb(0 0 0 / .5);
}
[data-theme='light'] .demo-ticket { box-shadow: 0 1px 2px rgb(20 16 8 / .16), 0 6px 14px -6px rgb(0 0 0 / .35), 0 30px 54px -18px rgb(0 0 0 / .7); }
[data-theme='light'] .demo-scan { background: linear-gradient(100deg, transparent 30%, rgb(12 11 9 / .05) 47%, rgb(var(--signal-rgb) / .16) 53%, transparent 70%); }

/* Narrower stage (the live page's current ~490 px column): same content, tighter spacing */
@container demostage (max-width: 560px) {
  .demo-tri__top { padding-block: 13px; }
  .demo-tri__body { padding: 14px; }
  .demo-mail { padding: 11px 12px; }
  .demo-link { height: 22px; }
  .demo-ticket { padding: 12px 12px 10px; }
  .demo-fields { margin-top: 8px; }
  .demo-frow { grid-template-columns: 64px minmax(0, 1fr) 80px 32px; gap: 10px; padding: 6px 0; }
  .demo-ticket__foot { padding-top: 10px; }
  .demo-toast { margin-top: 10px; padding: 8px 12px; }
  .demo-trend { margin-top: 10px; padding: 9px 12px; }
  .demo-trend svg { height: 32px; }
  .demo-step { min-height: 46px; }
}
/* On a phone the bars give up width so "Access and identity" and "Left for an agent" read whole instead of ending in an ellipsis. */
@container demostage (max-width: 380px) {
  .demo-frow { grid-template-columns: 58px minmax(0, 1fr) 46px 30px; }
  .demo-bar b::after { display: none; }
}
@container demostage (max-width: 340px) {
  .demo-frow { grid-template-columns: 56px minmax(0, 1fr) 32px 28px; gap: 8px; }
  .demo-frow .v { white-space: normal; line-height: 1.3; text-wrap: balance; }
}
/* Phone widths: drop the secondary details */
@container demostage (max-width: 420px) {
  .demo-tri__box, .demo-learned, .demo-trend, .demo-step span { display: none; }
  .demo-ticket__foot { justify-content: flex-end; }
}

/* Learning board */
.demo-board { position: relative; height: 300px; overflow: hidden; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.demo-region { position: absolute; top: 0; bottom: 0; padding: 14px 16px; font-size: 12px; color: var(--muted); }
.demo-region + .demo-region { border-left: 1px solid var(--line); }
.demo-region b { display: block; margin-top: 4px; font: 500 18px/1.2 var(--mono); color: var(--text); }
.demo-region--pile { left: 0; width: var(--pile-w); background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--text) 2%, transparent) 10px 20px); }
.demo-region--lane b { color: var(--signal); }
.demo-dot { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 2px; transition: transform .95s var(--ease) calc(var(--d) * 1s); }
/* The square is the ticket. Waiting ones fidget in the pile; a sorted one sits still in its lane. */
.demo-dot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--text) 26%, transparent); --amp: calc(.7 + var(--w, .5) * .6); transition: background-color .5s calc(var(--d) * 1s); animation: demo-rattle calc(.8s + var(--p, .5) * 1s) cubic-bezier(.45, .05, .2, 1) infinite; animation-delay: calc(var(--w, 0) * -3.4s); }
.demo-dot.is-sorted::after { background: var(--signal); animation: none; }
.demo-board:not(.is-awake) .demo-dot::after,
.xomea-motion-paused .demo-dot::after { animation: none; }
@keyframes demo-rattle {
  0%, 90%, 100% { transform: none; }
  8%, 16% { transform: translate(calc(2.4px * var(--amp)), calc(-1.5px * var(--amp))) rotate(calc(-14deg * var(--amp))); }
  28% { transform: translate(calc(-2px * var(--amp)), calc(1.7px * var(--amp))) rotate(calc(12deg * var(--amp))); }
  42% { transform: translate(calc(.7px * var(--amp)), calc(-.5px * var(--amp))) rotate(calc(-5deg * var(--amp))); }
  54%, 64% { transform: translate(calc(-2.2px * var(--amp)), calc(-1.3px * var(--amp))) rotate(calc(10deg * var(--amp))); }
  78% { transform: translate(calc(1.6px * var(--amp)), calc(2px * var(--amp))) rotate(calc(-11deg * var(--amp))); }
}
.demo-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 48px; align-items: start; margin-top: 24px; }
.demo-slider label { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.demo-slider output { font: 500 18px/1 var(--mono); color: var(--text); }
.demo-slider input[type='range'] { width: 100%; height: 22px; margin: 12px 0 6px; accent-color: var(--signal); cursor: pointer; }
.demo-ticks { display: flex; justify-content: space-between; font: 400 11px/1 var(--mono); color: var(--faint); }
.demo-seg { margin: 0; padding: 0; border: 0; }
.demo-seg legend { margin-bottom: 10px; padding: 0; font-size: 14px; color: var(--muted); }
.demo-seg div { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line-2); border-radius: 8px; }
.demo-seg input { position: absolute; opacity: 0; pointer-events: none; }
.demo-seg label { padding: 8px 14px; border-radius: 5px; font-size: 13px; font-weight: 500; line-height: 1; color: var(--muted); cursor: pointer; }
.demo-seg input:checked + label { background: var(--raise); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.demo-seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-readout { grid-column: 1 / -1; min-height: 1.6em; font-size: 16px; color: var(--text); }
.demo-readout span { color: var(--signal); }
.demo-note { margin-top: 14px; font-size: 12px; color: var(--faint); }

/* Search playground */
.demo-search__grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 56px; align-items: start; }
.demo-search .section-heading { margin-bottom: 28px; }
/* The search note sits under the results' right edge, beside the Keyword / Meaning tags it qualifies. */
.demo-search .demo-note { text-align: right; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-chips > span { width: 100%; font-size: 12px; color: var(--faint); }
.demo-chip { padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 999px; background: none; font-size: 13px; line-height: 1; color: var(--muted); }
.demo-chip:hover { color: var(--text); }
.demo-chip[aria-pressed='true'] { border-color: rgb(var(--signal-rgb) / .5); background: rgb(var(--signal-rgb) / .08); color: var(--text); }
/* The search field is a lit plate (23 November 2026, the user's request: the section read blank beside
   the rest of the page). Its 1px edge stays a border, so nothing moves: a gradient on the border box
   catches teal light at the left, where the query starts. The two engines that run on every search
   sit at its right edge with their counts; they flicker while the query is typed. */
.demo-search__stage { position: relative; container: demosearch / inline-size; }
.demo-sbox { position: relative; display: flex; align-items: center; gap: 12px; padding: 15px 18px; border: 1px solid transparent; border-radius: 10px; font-size: 17px; color: var(--text); container: demosbox / inline-size;
  background:
    radial-gradient(46% 150% at 0% 50%, rgb(var(--signal-rgb) / .09), transparent 72%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(100deg, rgb(var(--signal-rgb) / .55), var(--line-2) 28%, var(--line-2) 72%, rgb(var(--signal-rgb) / .22)) border-box;
  box-shadow: 0 24px 48px -30px rgb(0 0 0 / .8), 0 0 70px -42px rgb(var(--signal-rgb) / .5);
  transition: box-shadow .5s var(--ease); }
.demo-sbox.is-typing { box-shadow: 0 24px 48px -30px rgb(0 0 0 / .8), 0 0 70px -32px rgb(var(--signal-rgb) / .7); }
[data-theme='light'] .demo-sbox { box-shadow: 0 24px 48px -34px rgb(40 30 10 / .3), 0 0 70px -42px rgb(var(--signal-rgb) / .35); }
[data-theme='light'] .demo-sbox.is-typing { box-shadow: 0 24px 48px -34px rgb(40 30 10 / .3), 0 0 70px -32px rgb(var(--signal-rgb) / .5); }
.demo-sbox svg { flex: none; color: var(--faint); }
.demo-caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -3px; background: var(--signal); opacity: 0; }
.demo-sbox.is-typing .demo-caret { opacity: 1; }
.demo-engines { display: flex; gap: 16px; margin-left: auto; font-size: 12px; line-height: 1; white-space: nowrap; color: var(--faint); }
.demo-engine { display: inline-flex; align-items: center; gap: 7px; }
.demo-engine i { flex: none; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 55%, transparent); }
.demo-engine--meaning i { background: var(--signal); box-shadow: 0 0 0 3px rgb(var(--signal-rgb) / .16); }
.demo-engine b { min-width: 1ch; font: 500 12px/1 var(--mono); color: var(--text); transition: opacity .3s var(--ease); }
.demo-sbox.is-typing .demo-engine b { opacity: .25; }
.demo-sbox.is-typing .demo-engine i { animation: demo-engine 0.5s ease-in-out infinite alternate; }
.demo-sbox.is-typing .demo-engine--meaning i { animation-delay: -.25s; }
@keyframes demo-engine { from { opacity: .3; } to { opacity: 1; } }
@container demosbox (max-width: 480px) {
  .demo-engines { gap: 12px; }
  .demo-engine > span { display: none; }
}
/* The merge rail (js/home-demo.js): the query leaves the field's lens, splits into a keyword lane and a
   meaning lane, and each result joins the list from the lane that found it. The rows give it 34px. */
.demo-merge { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.demo-results { list-style: none; margin: 10px 0 0; padding: 0 0 0 34px; }
.demo-res { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 3px 14px; align-items: baseline; padding: 13px 4px; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease) calc(var(--i) * 90ms), transform .5s var(--ease) calc(var(--i) * 90ms), background-color .3s var(--ease); }
.demo-results.is-shown .demo-res { opacity: 1; transform: none; }
.demo-res:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--text) 4%, transparent), transparent 70%); }
.demo-res:has(.demo-tag--meaning):hover { background: linear-gradient(90deg, var(--teal-wash, rgb(var(--signal-rgb) / .08)), transparent 70%); }
.demo-res__id { font: 400 11px/1 var(--mono); color: var(--faint); }
.demo-res__t { font-size: 14px; color: var(--text); }
.demo-res__t mark { background: none; color: inherit; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--text) 35%, transparent); }
/* A meaning match marks the words that carry the meaning, dotted in the meaning lane's colour. */
.demo-res__t mark.demo-m { box-shadow: none; text-decoration: underline dotted rgb(var(--signal-rgb) / .85); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.demo-res__why { grid-column: 2; font-size: 12px; color: var(--faint); }
.demo-tag { grid-row: 1; grid-column: 3; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 11px; white-space: nowrap; color: var(--muted); }
.demo-tag--meaning { border-color: rgb(var(--signal-rgb) / .4); color: var(--signal); }

/* What the search looks through, under the example searches. It fills the room the side-by-side
   layout leaves under the chips, never more, so the section keeps its height (checked from 1100 to
   1440px). Where the column is too narrow for one row, or the layout stacks, it steps aside. */
.demo-search__grid > :first-child { container: demosearchcopy / inline-size; }
.demo-scope { margin-top: 24px; }
.demo-scope p { margin: 0 0 8px; font-size: 12px; color: var(--faint); }
/* Four equal cells across the column, so the dividers fall at even steps and the last cell meets the
   column's right edge (23 November 2026, the user's request: cleaner and more aligned). */
.demo-scope ul { display: grid; grid-template-columns: repeat(4, minmax(max-content, 1fr)); margin: 0; padding: 0; list-style: none; border-block: 1px solid var(--line); }
.demo-scope li { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 13px; line-height: 1.2; color: var(--muted); }
.demo-scope li:first-child { padding-left: 0; }
.demo-scope li + li { border-left: 1px solid var(--line); }
.demo-scope svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--signal); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
@container demosearchcopy (max-width: 419px) { .demo-scope { display: none; } }
@media (max-width: 960px) {
  .demo-search__grid, .demo-controls { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .demo-scope { display: none; }
}
/* On a phone the titles need every pixel (the rail's 34px wrapped them onto more lines and the section
   grew), so the rail steps aside there; the lamps and the dotted meaning marks still tell the two apart. */
@container demosearch (max-width: 540px) {
  .demo-results { padding-left: 0; }
  .demo-merge { display: none; }
}
@media (max-width: 700px) {
  .demo-board { height: 270px; }
  /* Four lanes share a phone-width board: tighter insets and a smaller label keep "Hardware" inside the last lane. */
  .demo-region { padding: 12px 8px; }
  .demo-region--lane { padding-inline: 6px; font-size: 11px; }
}
@media (max-width: 359px) {
  .demo-region--lane { padding-inline: 5px; font-size: 10px; }
}
.xomea-motion-paused .demo-art img, .xomea-motion-paused .demo-art::after { transition: none; }
.xomea-motion-paused .demo-sky { display: none; }
