/* Public demos: an animated hero stage, live schematic previews and pointer-lit cards. */
.demos-page { overflow-x: clip; }
.demos-page header { position: relative; z-index: 1; backdrop-filter: blur(6px); }

/* Background: drifting light and a scrolling perspective grid. */
.demos-sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.demos-sky b { position: absolute; inline-size: 46vmax; aspect-ratio: 1; border-radius: 50%; filter: blur(80px); opacity: .2; animation: demos-roam 24s ease-in-out infinite alternate; }
.demos-sky b:nth-child(1) { background: var(--sky1, #dbf389); left: -12vmax; top: -16vmax; }
.demos-sky b:nth-child(2) { background: var(--sky2, #3fd4b0); right: -14vmax; top: 12vh; animation-duration: 31s; animation-delay: -9s; }
.demos-sky b:nth-child(3) { background: var(--sky3, #ff5fa2); left: 30vw; bottom: -26vmax; opacity: .13; animation-duration: 37s; }
.demos-floor {
  position: absolute; left: -50%; right: -50%; bottom: 0; block-size: 42vh;
  background-image: linear-gradient(color-mix(in srgb, var(--accent) 18%, #0000) 1px, #0000 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, #0000) 1px, #0000 1px);
  background-size: 4rem 4rem;
  transform: perspective(26rem) rotateX(64deg); transform-origin: 50% 100%;
  mask-image: linear-gradient(#0000, #000 80%);
  animation: demos-floor 3.5s linear infinite;
}
@keyframes demos-roam { to { translate: 9vmax 7vmax; scale: 1.18; } }
@keyframes demos-floor { to { background-position: 0 4rem; } }

main.demos { align-content: start; gap: clamp(3.5rem, 9vh, 6rem); padding-block: clamp(1.5rem, 5vh, 3.5rem) 7rem; }

/* Hero */
.demos-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 2rem 3rem; min-block-size: min(44rem, 78svh); }
.demos-copy { display: grid; gap: 1.4rem; justify-items: start; }
.demos-eyebrow { margin: 0; font-size: .82rem; letter-spacing: .08em; color: var(--muted, #a9a89c); }
.demos-eyebrow span { color: var(--accent); margin-inline-end: .5rem; text-shadow: 0 0 .6rem var(--accent); animation: demos-pulse 1.6s ease-in-out infinite; }
.demos-hero h1 { max-inline-size: none; translate: none; font-size: clamp(2.5rem, 6vw, 5.2rem); line-height: .98; }
.demos-hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--g2, #7ef0c9), var(--g3, #ff7ab8), var(--g4, #ffd36a), var(--accent)) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: #0000;
  animation: demos-shimmer 9s linear infinite;
}
.demos-lead { margin: 0; max-inline-size: 46ch; color: var(--muted, #c6c5b9); line-height: 1.6; }
.demos-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; }
.demos-cta {
  position: relative; overflow: hidden; display: inline-flex; gap: .6rem;
  padding: .9rem 1.35rem; border-radius: .6rem;
  background: var(--cta, var(--accent)); color: var(--on-cta, #181917); font-weight: 700;
  box-shadow: 0 .9rem 2.4rem -.7rem color-mix(in srgb, var(--accent) 60%, #0000);
  transition: translate .15s, box-shadow .15s;
}
.demos-cta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, #0000 35%, #fff9 50%, #0000 65%) 200% 0 / 250% 100% no-repeat; animation: demos-shine 3.2s ease-in-out infinite; }
.demos-cta:hover { color: var(--on-cta, #181917); translate: 0 -2px; box-shadow: 0 1.2rem 2.8rem -.6rem color-mix(in srgb, var(--accent) 80%, #0000); }
.demos-cta span { transition: translate .15s; }
.demos-cta:hover span { translate: .25rem 0; }
.demos-browse { color: var(--muted, #c6c5b9); border-block-end: 1px solid var(--rule); padding-block-end: .15rem; }
.demos-stats { display: flex; gap: 2.4rem; margin: .6rem 0 0; }
.demos-stats div { display: flex; flex-direction: column-reverse; gap: .2rem; }
.demos-stats dd { margin: 0; font-size: 2rem; font-weight: 700; color: var(--accent); letter-spacing: -.04em; }
.demos-stats dt { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint, #8f8e83); }
@keyframes demos-pulse { 50% { opacity: .35; } }
@keyframes demos-shimmer { to { background-position: 300% 0; } }
@keyframes demos-shine { 0%, 55% { background-position: 200% 0; } 100% { background-position: -100% 0; } }

/* A floating stack of three live desktops that turns towards the pointer. */
.demos-stage { position: relative; block-size: clamp(19rem, 40vw, 31rem); perspective: 1400px; }
.demos-stage::after { content: ''; position: absolute; inset: auto 10% -6% 10%; block-size: 22%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, #0000), #0000); filter: blur(18px); z-index: -1; }
.demos-stage-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--py, 12deg)) rotateY(var(--px, -20deg));
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
  animation: demos-float 7s ease-in-out infinite alternate;
}
.demo-preview.stage-card { position: absolute; inline-size: 72%; border-radius: .7rem; box-shadow: 0 2.2rem 3.5rem -1.2rem #000d, 0 0 0 1px #ffffff1c; }
.stage-card:nth-child(1) { left: 2%; top: 0; transform: translateZ(-70px); }
.stage-card:nth-child(2) { left: 27%; top: 27%; transform: translateZ(30px); }
.stage-card:nth-child(3) { left: 8%; top: 54%; transform: translateZ(120px); }
@keyframes demos-float { to { translate: 0 -14px; } }

/* Sections and cards */
.demo-section { display: grid; gap: .5rem; scroll-margin-block-start: 2rem; }
.demo-section h2 { display: flex; align-items: baseline; gap: .8rem; margin: 0; font-size: .85rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.demo-section h2 span { font-size: 2.6rem; letter-spacing: -.04em; color: #0000; -webkit-text-stroke: 1px #6d7060; }
.demo-section > p { margin: 0; color: var(--muted, #a9a89c); }
.demo-boxes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1.1rem; margin: .9rem 0 0; padding: 0; list-style: none;
}
.demo-boxes li {
  --mx: 50%; --my: -30%;
  position: relative; display: grid; gap: .35rem;
  padding: .75rem .75rem 1.1rem;
  border: 1px solid var(--rule); border-radius: .85rem;
  background: radial-gradient(20rem circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 13%, #0000), #0000 70%), var(--card, #1d1f1acc);
  transform: perspective(60rem) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: border-color .2s, translate .2s, box-shadow .2s, transform .25s ease-out;
}
.demo-boxes li:hover, .demo-boxes li:focus-within { border-color: var(--accent); translate: 0 -4px; box-shadow: 0 1.4rem 2.6rem -1.2rem color-mix(in srgb, var(--accent) 35%, #0000); }
.demo-boxes a { font-size: 1.15rem; font-weight: 700; padding-inline: .25rem; margin-block-start: .5rem; }
.demo-boxes a span { display: inline-block; margin-inline-start: .4rem; font-size: .9em; opacity: .55; transition: translate .2s, opacity .2s; }
.demo-boxes li:hover a span { translate: .15rem -.15rem; opacity: 1; }
.demo-boxes a:hover { color: var(--accent); }
.demo-boxes a:focus-visible { outline: none; }
.demo-boxes li:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.demo-boxes a::after { content: ''; position: absolute; inset: 0; }
.demo-boxes small { padding-inline: .25rem; color: var(--faint, #8f8e83); font-size: .75rem; text-transform: capitalize; }
.demo-boxes p { margin: 0; color: var(--muted, #c6c5b9); line-height: 1.5; padding-inline: .25rem; }
@supports (animation-timeline: view()) {
  .demo-boxes li { animation: demos-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
}
@keyframes demos-rise { from { opacity: 0; scale: .92; } }

/* Schematic previews: each window is a tiny animated app in the demo's theme. */
.demo-preview {
  --wall: #10302c; --win: #173f3a; --bar: #dbf389; --edge: #2d5c55;
  --screen: #0a1714; --ink: #dbf389; --dim: #6f958b; --folder: #c9b45a;
  --l: 3.4cqi; --t: 1.1cqi;
  container-type: inline-size;
  position: relative; display: grid; grid-template-columns: 3fr 2fr; grid-auto-flow: dense; gap: 4px;
  aspect-ratio: 16 / 9; padding: 16px 6px 6px; border-radius: .5rem;
  background: var(--wall); overflow: hidden;
}
.demo-preview::before { content: ''; position: absolute; inset: 0 0 auto; block-size: 10px; background: var(--edge); z-index: 1; }
.demo-preview::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(#0000 40%, color-mix(in srgb, var(--accent) 35%, #0000) 50%, #0000 60%) 0 -100% / 100% 200% no-repeat;
}
.demo-boxes li:hover .demo-preview::after { animation: demos-scan .7s ease-out; }
@keyframes demos-scan { to { background-position: 0 200%; } }

.demo-preview i { position: relative; overflow: hidden; border: 1px solid var(--edge); border-block-start: 5px solid var(--bar); border-radius: 3px; background: var(--win); }
.demo-preview i::before, .demo-preview i::after { content: ''; position: absolute; }
.demo-preview[data-shell="tiled"]:not([data-layout="tiled-tools"]) i:first-child { grid-row: span 2; }
.demo-preview[data-shell="tiled"] i { animation: demos-focus 6s infinite; }
.demo-preview[data-shell="tiled"] i:nth-child(2) { animation-delay: -4s; }
.demo-preview[data-shell="tiled"] i:nth-child(3) { animation-delay: -2s; }
@keyframes demos-focus { 0%, 30% { border-block-start-color: var(--bar); } 36%, 94% { border-block-start-color: var(--dim); } }
.demo-preview[data-shell="floating"] { display: block; }
.demo-preview[data-shell="floating"] i { position: absolute; inline-size: 52%; block-size: 50%; box-shadow: 0 6px 14px #0006; animation: demos-drift 9s ease-in-out infinite alternate; }
.demo-preview[data-shell="floating"] i:nth-child(1) { left: 8%; top: 22%; }
.demo-preview[data-shell="floating"] i:nth-child(2) { left: 32%; top: 38%; animation-duration: 11s; animation-direction: alternate-reverse; }
.demo-preview[data-shell="floating"] i:nth-child(3) { left: 50%; top: 18%; inline-size: 40%; animation-duration: 13s; }
.demo-preview[data-shell="floating"] i:only-child { left: 14%; top: 24%; inline-size: 64%; block-size: 60%; }
@keyframes demos-drift { to { translate: 2cqi -1.5cqi; } }

.demo-preview[data-theme="neon"] {
  --win: #fbfbf7; --bar: #ff3d8b; --edge: #1d1d1d; --screen: #1d1d1d; --ink: #ff3d8b; --dim: #9aa3d6; --folder: #3d5bff;
  background: linear-gradient(#0000 calc(100% - 1px), #c9d1ff 0) 0 0 / 12px 12px, linear-gradient(90deg, #0000 calc(100% - 1px), #c9d1ff 0) 0 0 / 12px 12px, #eef0ff;
}
.demo-preview[data-theme="neon"] i { box-shadow: 3px 3px 0 #1d1d1d; }
.demo-preview[data-theme="graphite"] {
  --win: #1f201d; --bar: #dbf389; --edge: #494c41; --screen: #121311; --ink: #dbf389; --dim: #6d705f; --folder: #7ef0c9;
  background: linear-gradient(#dbf38912 1px, #0000 1px) 0 0 / 12px 12px, linear-gradient(90deg, #dbf38912 1px, #0000 1px) 0 0 / 12px 12px, radial-gradient(circle at 10% 0, #dbf38930, #0000 60%), #181917;
}
.demo-preview[data-theme="retro"] { --wall: #008080; --win: #c0c0c0; --bar: #000080; --edge: #c0c0c0; --screen: #000; --ink: #c0c0c0; --dim: #808080; }
.demo-preview[data-theme="retro"] i { border: 2px outset #dfdfdf; border-block-start: 7px solid #000080; border-radius: 0; }
.demo-preview[data-theme="retro"]::before { inset: auto 0 0; background: #c0c0c0; border-block-start: 1px solid #fff; }

.demo-preview[data-layout="tiled-tools"] i[data-app="clock"]::before {
  inset: 15% 30%; aspect-ratio: 1; margin: auto; max-height: 70%;
  border: 2px solid var(--bar); border-radius: 50%;
  background: conic-gradient(var(--bar) 25%, transparent 0);
}

/* Terminal: lines typed out, then a blinking cursor. */
.demo-preview i[data-app="terminal"] { background: var(--screen); }
.demo-preview i[data-app="terminal"]::before {
  inset: 1.6cqi 1.8cqi;
  background:
    linear-gradient(var(--ink) 0 0) 0 0 / 34% var(--t),
    linear-gradient(var(--dim) 0 0) 0 calc(var(--l) * 1) / 72% var(--t),
    linear-gradient(var(--dim) 0 0) 0 calc(var(--l) * 2) / 58% var(--t),
    linear-gradient(var(--ink) 0 0) 0 calc(var(--l) * 3) / 44% var(--t),
    linear-gradient(var(--dim) 0 0) 0 calc(var(--l) * 4) / 80% var(--t),
    linear-gradient(var(--dim) 0 0) 0 calc(var(--l) * 5) / 30% var(--t),
    linear-gradient(var(--ink) 0 0) 0 calc(var(--l) * 6) / 50% var(--t);
  background-repeat: no-repeat;
  animation: demos-type 5s infinite;
}
.demo-preview i[data-app="terminal"]::after { left: 1.8cqi; top: calc(1.6cqi + var(--l) * 7 - .3cqi); inline-size: 1.5cqi; block-size: 1.8cqi; background: var(--ink); animation: demos-blink 1s steps(1) infinite; }
@keyframes demos-type { 0% { clip-path: inset(0 0 100% 0); animation-timing-function: steps(7); } 65%, 100% { clip-path: inset(0); } }
@keyframes demos-blink { 50% { opacity: 0; } }

/* Files: a folder grid with a moving selection. */
.demo-preview i[data-app="files"]::before {
  inset: 2cqi; background: var(--folder);
  mask: repeating-linear-gradient(90deg, #000 0 4.6cqi, #0000 0 7cqi), repeating-linear-gradient(#000 0 3.6cqi, #0000 0 6cqi);
  mask-composite: intersect;
}
.demo-preview i[data-app="files"]::after { left: 1.4cqi; top: 1.4cqi; inline-size: 5.8cqi; block-size: 4.8cqi; border: .4cqi solid var(--bar); border-radius: .6cqi; animation: demos-select 4s steps(1) infinite; }
@keyframes demos-select { 25% { translate: 7cqi 0; } 50% { translate: 14cqi 0; } 75% { translate: 7cqi 6cqi; } }

/* Web Search: a query field, results and a loading sheen. */
.demo-preview i[data-app="search"]::before {
  inset: 1.6cqi;
  background:
    linear-gradient(var(--screen) 0 0) 0 0 / 100% 3.2cqi,
    linear-gradient(var(--ink) 0 0) 0 5.4cqi / 60% var(--t), linear-gradient(var(--dim) 0 0) 0 7.4cqi / 86% var(--t),
    linear-gradient(var(--ink) 0 0) 0 11cqi / 50% var(--t), linear-gradient(var(--dim) 0 0) 0 13cqi / 78% var(--t),
    linear-gradient(var(--ink) 0 0) 0 16.6cqi / 64% var(--t), linear-gradient(var(--dim) 0 0) 0 18.6cqi / 70% var(--t);
  background-repeat: no-repeat;
}
.demo-preview i[data-app="search"]::after { inset: 0; background: linear-gradient(100deg, #0000 30%, #ffffff40 50%, #0000 70%) 150% 0 / 250% 100% no-repeat; animation: demos-sheen 2.8s ease-in-out infinite; }
@keyframes demos-sheen { to { background-position: -50% 0; } }

/* Agent: a conversation that fills in while the Agent is typing. */
.demo-preview i[data-app="agent"]::before {
  inset: 1.6cqi 1.6cqi 4cqi;
  background:
    linear-gradient(var(--bar) 0 0) 100% 0 / 55% 3.6cqi,
    linear-gradient(var(--dim) 0 0) 0 5.6cqi / 80% var(--t), linear-gradient(var(--dim) 0 0) 0 7.6cqi / 62% var(--t), linear-gradient(var(--dim) 0 0) 0 9.6cqi / 72% var(--t),
    linear-gradient(var(--bar) 0 0) 100% 13cqi / 40% 3.6cqi,
    linear-gradient(var(--dim) 0 0) 0 18.6cqi / 76% var(--t), linear-gradient(var(--dim) 0 0) 0 20.6cqi / 54% var(--t);
  background-repeat: no-repeat;
  animation: demos-type 7s infinite;
}
.demo-preview i[data-app="agent"]::after { left: 1.6cqi; bottom: 1.2cqi; inline-size: 7cqi; block-size: 2cqi; background: radial-gradient(circle, var(--ink) 0 .7cqi, #0000 .8cqi) 0 50% / 2.3cqi 100% repeat-x; animation: demos-pulse 1s ease-in-out infinite; }

/* Retro Games: OpenTTD traffic, Freeciv exploration and Frozen Bubble shots. */
.demo-preview i[data-app="ttd"] { background: #4e8a3a; }
.demo-preview i[data-app="ttd"]::before {
  inset: 0;
  background:
    linear-gradient(#b8854f 0 0) 72% 18% / 4cqi 4cqi, linear-gradient(#c9c1d9 0 0) 16% 16% / 3cqi 5cqi, linear-gradient(#d9b25b 0 0) 84% 82% / 5cqi 3cqi,
    linear-gradient(#7b7b7b 0 0) 0 50% / 100% 2.6cqi, linear-gradient(#7b7b7b 0 0) 40% 0 / 2.6cqi 100%,
    repeating-linear-gradient(90deg, #0000 0 3cqi, #0002 0 3.2cqi), repeating-linear-gradient(#0000 0 3cqi, #0002 0 3.2cqi);
  background-repeat: no-repeat;
}
.demo-preview i[data-app="ttd"]::after { top: calc(50% - .8cqi); left: -4cqi; inline-size: 3cqi; block-size: 1.6cqi; background: #d33; box-shadow: 1.2cqi 0 #eee inset; animation: demos-drive 5s linear infinite; }
@keyframes demos-drive { to { left: 104%; } }
@property --fog { syntax: '<percentage>'; inherits: false; initial-value: 15%; }
.demo-preview i[data-app="civ"] { background: #2b5fa6; }
.demo-preview i[data-app="civ"]::before {
  inset: 0;
  background:
    radial-gradient(ellipse 10% 9% at 56% 26%, #c9b26b 96%, #0000),
    radial-gradient(ellipse 30% 26% at 32% 44%, #6aa84f 96%, #0000),
    radial-gradient(ellipse 22% 30% at 72% 62%, #8cbf5a 96%, #0000);
  animation: demos-zoom 12s ease-in-out infinite alternate;
}
.demo-preview i[data-app="civ"]::after { --fog: 15%; inset: 0; background: radial-gradient(circle at 40% 46%, #0000 var(--fog), #000c calc(var(--fog) + 8%)); animation: demos-explore 9s ease-in-out infinite alternate; }
@keyframes demos-zoom { to { scale: 1.18; } }
@keyframes demos-explore { to { --fog: 75%; } }
.demo-preview i[data-app="bubble"] { background: #1b2340; }
.demo-preview i[data-app="bubble"]::before {
  inset: 1cqi 1cqi auto; block-size: 11cqi;
  background:
    radial-gradient(circle, #e94b4b 0 1.3cqi, #0000 1.4cqi) 0 0 / 3cqi 3cqi repeat-x,
    radial-gradient(circle, #4bb3e9 0 1.3cqi, #0000 1.4cqi) 1.5cqi 2.6cqi / 3cqi 3cqi repeat-x,
    radial-gradient(circle, #f3d23c 0 1.3cqi, #0000 1.4cqi) 0 5.2cqi / 3cqi 3cqi repeat-x,
    radial-gradient(circle, #6be36b 0 1.3cqi, #0000 1.4cqi) 1.5cqi 7.8cqi / 3cqi 3cqi repeat-x;
  background-repeat: repeat-x;
}
.demo-preview i[data-app="bubble"]::after { left: calc(50% - 1.3cqi); bottom: 1cqi; inline-size: 2.6cqi; block-size: 2.6cqi; border-radius: 50%; background: #b06be3; animation: demos-shoot 2.4s ease-in infinite; }
@keyframes demos-shoot { 70% { translate: 3cqi -12cqi; opacity: 1; } 100% { translate: 3cqi -12cqi; opacity: 0; } }

/* Arena: a flickering corridor with a strafing enemy and a bobbing weapon. */
.demo-preview[data-theme="arena"] { display: block; padding: 0; background: radial-gradient(circle at 50% 120%, #ff7a2a, #5b1a0d 55%, #120706); animation: demos-flicker 3s steps(1) infinite; }
.demo-preview[data-theme="arena"]::before { inset: auto 0 0; block-size: 18%; background: #2a2a24; border-block-start: 2px solid #6d6a5c; }
.demo-preview i[data-app="arena"] {
  position: absolute; inset: 0 0 18%; border: 0; border-radius: 0;
  background: linear-gradient(100deg, #2b1610 0 16%, #0000 16.2%), linear-gradient(-100deg, #2b1610 0 16%, #0000 16.2%), linear-gradient(#0000 56%, #3a1d12 56%, #1a0c08);
}
.demo-preview i[data-app="arena"]::before {
  left: 48%; bottom: 36%; inline-size: 6cqi; block-size: 11cqi;
  background: radial-gradient(circle at 50% 16%, #c2442a 0 1.4cqi, #0000 1.5cqi), linear-gradient(#8a2a17 0 0) 50% 100% / 70% 72% no-repeat;
  animation: demos-strafe 3.4s ease-in-out infinite alternate;
}
.demo-preview i[data-app="arena"]::after {
  left: calc(50% - 5cqi); bottom: -2cqi; inline-size: 10cqi; block-size: 13cqi; border-radius: 1cqi 1cqi 0 0;
  background: linear-gradient(90deg, #3c3c34, #6d6a5c 50%, #3c3c34);
  animation: demos-bob 1.2s ease-in-out infinite alternate, demos-fire 3s steps(1) infinite;
}
@keyframes demos-flicker { 0%, 100% { filter: none; } 47% { filter: brightness(1.35); } 50% { filter: none; } 82% { filter: brightness(1.2); } 84% { filter: none; } }
@keyframes demos-strafe { to { translate: -14cqi 1cqi; } }
@keyframes demos-bob { to { translate: 1.4cqi 1cqi; } }
@keyframes demos-fire { 0%, 100% { box-shadow: none; } 47% { box-shadow: 0 -3cqi 4cqi 1cqi #ffd36a; } 50% { box-shadow: none; } }

@media (max-width: 56rem) {
  .demos-hero { grid-template-columns: minmax(0, 1fr); min-block-size: 0; }
  .demos-stage { block-size: 21rem; margin-block-start: 1rem; }
}
@media (max-width: 38rem) {
  .demos-stats { gap: 1.6rem; }
  .demos-stage { block-size: 17rem; }
}
/* WebGPU: a lit cube spins over a receding grid, as kmscube draws it. */
.demo-preview[data-layout="webgpu"] i[data-app="gpu"] { left: 12%; top: 18%; inline-size: 76%; block-size: 70%; background: radial-gradient(circle at 50% 42%, #2a1a4a, #0b0b16 70%); perspective: 40cqi; }
.demo-preview i[data-app="gpu"]::before {
  inset: 58% -30% -40%; transform: rotateX(72deg);
  background: linear-gradient(#ff3d8bcc 1px, #0000 1px) 0 0 / 100% 3cqi, linear-gradient(90deg, #7ea0ffaa 1px, #0000 1px) 0 0 / 3cqi 100%;
  mask: linear-gradient(#0000, #000 60%); animation: demos-grid 1.6s linear infinite;
}
.demo-preview i[data-app="gpu"]::after { inset: auto 1.4cqi 1cqi auto; content: '60 fps'; font: 700 2cqi/1 ui-monospace, monospace; color: #7ef0c9; }
@keyframes demos-grid { to { background-position: 0 3cqi, 0 0; } }
.demo-preview i[data-app="gpu"] b { --s: 19cqi; position: absolute; left: calc(50% - var(--s) / 2); top: calc(40% - var(--s) / 2); filter: drop-shadow(0 0 2.4cqi #ff3d8b88); inline-size: var(--s); block-size: var(--s); transform-style: preserve-3d; animation: demos-spin 7s linear infinite; }
.demo-preview i[data-app="gpu"] s { position: absolute; inset: 0; border: 1px solid #fff8; box-shadow: inset 0 0 3cqi #fff4; opacity: .92; }
.demo-preview i[data-app="gpu"] s:nth-child(1) { background: linear-gradient(135deg, #ff3d8b, #ffd36a); transform: translateZ(calc(var(--s) / 2)); }
.demo-preview i[data-app="gpu"] s:nth-child(2) { background: linear-gradient(135deg, #3d5bff, #7ef0c9); transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.demo-preview i[data-app="gpu"] s:nth-child(3) { background: linear-gradient(135deg, #7ef0c9, #ffd36a); transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.demo-preview i[data-app="gpu"] s:nth-child(4) { background: linear-gradient(135deg, #b06be3, #ff3d8b); transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.demo-preview i[data-app="gpu"] s:nth-child(5) { background: linear-gradient(135deg, #ffd36a, #3d5bff); transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.demo-preview i[data-app="gpu"] s:nth-child(6) { background: linear-gradient(135deg, #b06be3, #7ef0c9); transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
@keyframes demos-spin { from { transform: rotateX(-24deg) rotateY(0) rotateZ(0); } to { transform: rotateX(-24deg) rotateY(360deg) rotateZ(360deg); } }

/* Phones and touch devices run Boxes on the small machine without JIT; keep this page cheap there. */
@media (max-width: 38rem), (pointer: coarse) {
  .demos-sky { background: radial-gradient(60vmax circle at 0 0, color-mix(in srgb, var(--sky1, #dbf389) 14%, #0000), #0000 70%), radial-gradient(60vmax circle at 100% 30%, color-mix(in srgb, var(--sky2, #3fd4b0) 10%, #0000), #0000 70%); }
  .demos-sky b { display: none; }
  .demos-floor { animation: none; }
  .demos-page header { backdrop-filter: none; }
  .demos-stage-inner { animation: none; transition: none; }
  .demo-desktop-only { display: none; }
  .demo-boxes li { transform: none; }
  .demos-cta::after { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .demos-page *, .demos-page *::before, .demos-page *::after { animation: none !important; transition: none !important; }
  .demo-boxes li { transform: none; translate: none !important; }
}
.demos-index { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; font-size: .9rem; }
.demos-index a { color: var(--accent); }
