/* The animated demos, shared by the-thing.app/start and /help (decisions 38 and 39). Each plays the
   app's real sequence with its own approved words. The page provides the colors (--fg, --muted,
   --border, --surface, --surface-2, --shadow, --radius); web/beta/public/demos.js fills each
   <div class="demo" data-demo="…"></div>. */
/* Demos */
.demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.demo { border: var(--border); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.demo h3 { margin: 0; font-weight: 600; font-size: 18px; letter-spacing: -0.3px; }
.demo .what { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* The request: The Thing's Ask box on the Mac, or "Hey Thing" said to the Car Thing */
.ask { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 16px; border-radius: 14px;
  background: rgba(236, 236, 238, 0.92); color: #1c1c1e; box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.ask img { width: 22px; height: 22px; filter: invert(0.15); flex: none; }
.ask .typed { font-size: 17px; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.ask .typed::after { content: ""; display: inline-block; width: 2px; height: 20px; margin-left: 2px; vertical-align: -4px;
  background: #3a6df0; animation: blink 1s steps(1) infinite; }
.ask .typed.done::after { display: none; }
.ask .where { margin-left: auto; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #8b8b90; flex: none; }
@keyframes blink { 50% { opacity: 0; } }

/* The Car Thing, drawn: its screen is 800 x 480 */
.carthing { position: relative; margin: auto auto 0; width: 100%; max-width: 460px; padding: 14px; border-radius: 22px;
  background: linear-gradient(180deg, #232326 0%, #141416 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 20px 40px rgba(0,0,0,0.55); }
.carthing::before { /* the four buttons on top */
  content: ""; position: absolute; top: -6px; left: 14%; width: 44%; height: 6px; border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(90deg, #2a2a2d 0 21%, transparent 21% 26%); }
.carthing::after { /* the knob */
  content: ""; position: absolute; top: -18px; right: 22px; width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a3a3e 0%, #1a1a1c 70%); box-shadow: 0 4px 10px rgba(0,0,0,0.6); z-index: -1; }
.screen { position: relative; aspect-ratio: 800 / 480; border-radius: 8px; overflow: hidden; background: #050506; }
.screen img, .screen .video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.7s ease; }
.screen .on { opacity: 1; }
.video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
/* The video plays: a slow zoom into the frame while it shows */
.screen .video.on img { animation: playing 7s ease-out forwards; }
@keyframes playing { from { transform: scale(1); } to { transform: scale(1.14) translate(-2%, 1.5%); } }
/* The video's title, on top for 3 s as on the Car Thing */
.video span { position: absolute; left: 4%; right: 4%; top: 6%; color: #fff; font-weight: 600; font-size: clamp(13px, 2.6vw, 15px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Each request sits in a space of fixed height, with room for the Ask box at its largest: the box
   may grow, the card and the Car Thing below it never move. */
.req { height: 80px; }
/* The Ask box's line under the request ("Understanding…", "Building…"), as in the app */
.ask.panel { flex-wrap: wrap; row-gap: 0; }
.ask .status { flex-basis: 100%; font-size: 13px; color: #6e6e73; border-top: 1px solid rgba(0,0,0,0.1);
  margin-top: 8px; padding-top: 6px; min-height: 24px; }
.ask .status:empty { display: none; }
/* The Car Thing's own overlay: "Building…", "Listening…" with the words heard, "Thinking…" */
.screen .overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #0d0e12; opacity: 0; transition: opacity 0.25s ease; text-align: center; padding: 0 6%; }
.screen .overlay.on { opacity: 1; }
.screen .overlay b { font-size: clamp(18px, 4.4vw, 24px); font-weight: 600; }
.screen .overlay b.breathe { animation: breathe 1.2s ease-in-out infinite; }
.screen .overlay em { font-style: normal; font-size: clamp(14px, 3.2vw, 17px); margin-top: 10px; min-height: 1.2em; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
/* The words said out loud to the Car Thing */
.said { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.said .mic { width: 34px; height: 34px; border-radius: 50%; border: var(--border); background: var(--surface-2); flex: none;
  display: flex; align-items: center; justify-content: center; }
.said .words { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 19px; font-style: italic; color: var(--fg); opacity: 0; transition: opacity 0.3s ease; }
.said .words.on { opacity: 1; }
/* The Themes window's New Theme sheet, as in the app */
.sheet { background: rgba(236, 236, 238, 0.94); color: #1c1c1e; border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); font-size: 13px; }
.sheet h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.sheet .hint { color: #6e6e73; margin: 0 0 8px; }
.sheet .field { white-space: nowrap; overflow: hidden; background: #fff; border: 1px solid #c8c8cc; border-radius: 6px; padding: 0 8px; height: 32px; line-height: 30px; font-size: 14px; }
.sheet .field .typed::after { content: ""; display: inline-block; width: 2px; height: 16px; margin-left: 1px; vertical-align: -3px; background: #3a6df0; animation: blink 1s steps(1) infinite; }
.sheet .field .typed.done::after { display: none; }
.sheet .note { margin: 8px 0 0; height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #6e6e73; }
.sheet .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.sheet .buttons span { padding: 3px 12px; border-radius: 6px; background: #fff; border: 1px solid #c8c8cc; }
.sheet .buttons span.primary { background: #3a6df0; border-color: #3a6df0; color: #fff; }
.sheet .where { float: right; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #8b8b90; }

/* On a phone the note's longest line doesn't fit: it wraps, with room kept for two lines so the
   card doesn't move while the demo plays (Xavier, 2026-11-25). */
@media (max-width: 560px) {
  .sheet .note { height: auto; min-height: 36px; white-space: normal; line-height: 18px; }
}

/* A demo on its own in a column of text (the Help) */
.demo.single { max-width: 520px; margin: 28px 0; }
.still .screen > *, .still .screen .video img, .still .said .words { transition: none !important; animation: none !important; }
@media (max-width: 860px) { .demos { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .screen img, .screen .overlay { transition: none; }
  .ask .typed::after, .screen .video.on img, .screen .overlay b.breathe { animation: none; }
}
