:root {
  --page-bg: #00103b;
  --accent: #7f98fd;
  --text: #e8ecff;
  --muted: #9aa8e8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  background: var(--page-bg);
  color: var(--text);
}

main {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* Top-left stack of scenario tiles, floating so the scene stays centered.
   Compact, so six of them fit beside the scene on a laptop screen. */
.scenarios {
  position: absolute;
  top: 24px;
  left: 24px;
  display: grid;
  gap: 8px;
  width: 240px;
}

/* Phones: no room for a stack above the scene, so the tiles become a row
   that scrolls sideways */
@media (max-width: 600px) {
  .scenarios {
    top: 16px;
    right: 0;
    left: 0;
    display: flex;
    width: auto;
    padding: 0 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }

  .scenarios::-webkit-scrollbar {
    display: none;
  }

  .scenario-slot {
    flex: 0 0 220px;
    scroll-snap-align: start;
  }
}

/* A tile and, if it has a demo, its tool's switch */
.scenario-slot {
  position: relative;
  display: grid;
}

/* A tile: name and what it shows; clicking it runs the scenario */
.scenario {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 10px 14px 11px;
  border: 1px solid rgb(127 152 253 / 0.35);
  border-radius: 14px;
  /* Solid enough to read over the illustration when it has to sit on it */
  background: rgb(11 26 72 / 0.9);
  backdrop-filter: blur(8px);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.2s, box-shadow 0.2s;
}

/* The scenario on the monitor now */
.is-current .scenario {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(127 152 253 / 0.25);
}

.scenario-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.scenario-name::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(127 152 253 / 0.2);
}

.scenario-about {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.scenario:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgb(30 44 112 / 0.95);
  opacity: 1;
}

/* Busy while a scenario runs, except the one running */
.scenario:disabled {
  opacity: 0.5;
  cursor: default;
}

.is-current .scenario:disabled {
  opacity: 1;
}

/* Whether the scenario's tool is on, in the tile's top-right corner: on, the
   next message's context is built with it, or the app enforces it; off, it
   isn't, to see the problem again */
.scenario-use {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(154 168 232 / 0.3);
  cursor: pointer;
  transition: background 0.2s;
}

.scenario-use::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  transition: translate 0.2s ease-out;
}

.scenario-use[aria-checked="true"] {
  background: #4ade80;
}

.scenario-use[aria-checked="true"]::before {
  translate: 14px 0;
}

.scenario-use:hover:not(:disabled) {
  background: rgb(154 168 232 / 0.5);
}

.scenario-use[aria-checked="true"]:hover:not(:disabled) {
  background: #7cf0a6;
}

.scenario-use:disabled {
  opacity: 0.5;
  cursor: default;
}

.scenario-use:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Illustration: fits the viewport height, keeps the image's aspect ratio.
   It is the size container, so cqw below scales with the illustration. */
.scene {
  position: relative;
  container-type: inline-size;
  width: min(100%, calc((100vh - 32px) * 1086 / 1220));
  width: min(100%, calc((100dvh - 32px) * 1086 / 1220));
  aspect-ratio: 1086 / 1220;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.45);
}

.scene-image {
  display: block;
  width: 100%;
  height: 100%;
}

/* The card's views sit on top of each other; the chosen one fades in */
.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.scene[data-view="room"] .view-room,
.scene[data-view="app"] .view-app,
.scene[data-view="datacenter"] .view-datacenter {
  opacity: 1;
  visibility: visible;
}

/* The AltGPT app's module panels stacked down the card, full width while they
   fit its height, then shrinking together */
.view-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4cqw;
  padding: 5cqw;
  background: var(--page-bg);
}

/* The computer's metal panels behind its modules, out of their layout */
.view-app > .scene-image {
  position: absolute;
  inset: 0;
}

/* The Context Builder, 78cqw wide and centred, cropped to the panel's frame;
   the corners follow its rounded outline */
.module {
  position: relative;
  flex: 0 1 auto;
  width: 78cqw;
  min-height: 0;
  max-width: 100%;
  aspect-ratio: 1706 / 812;
  border-radius: 3% / 6.3%;
  overflow: hidden;
  box-shadow: 0 2cqw 5cqw rgb(0 0 0 / 0.4);
}

.module > img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Under the panel, the stack's gap below it: the HDD, then the NIC, each on
   its own */
.app-under {
  flex: none;
  align-self: flex-start;
  display: grid;
  grid-template-columns: 55cqw 40.6cqw;
  align-items: start;
}

/* The HDD, 3cqw left of the NIC and as tall: its frame fills 96.3% of its
   picture's height from 1.9% down (and ends 1.2% from its right), so the
   picture is 18.8 / 0.963 = 19.5cqw tall, nudged up to line up with it */
.hdd {
  position: relative;
  justify-self: end;
  width: 23.3cqw;
  aspect-ratio: 940 / 788;
  margin: -0.37cqw 2.72cqw 0 0;
}

.hdd > img {
  position: absolute;
  display: block;
}

.hdd-case {
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1.5cqw 3cqw rgb(0 0 0 / 0.4));
}

/* In the case picture's 1175 × 985: the platter fills the well, centred on
   (502, 425) with a radius of 240 */
.hdd-platter {
  top: 15.99%;
  left: 19.96%;
  width: 45.54%;
  height: 54.32%;
}

/* The arm turns about its bearing, at (84.18%, 33.2%) of its picture, which
   sits on the bracket at (942, 648). Parked off the platter until js/hdd.js
   swings it over a rack's tracks. */
.hdd-arm {
  top: 53.06%;
  left: 39.61%;
  width: 48.19%;
  height: 38.32%;
  transform-origin: 84.18% 33.2%;
  rotate: 85.9deg;
  transition: rotate 0.35s ease-in-out;
  filter: drop-shadow(0 0.4cqw 0.6cqw rgb(0 0 0 / 0.45));
}

/* The NIC, below the Context Builder's context tray, at the size it had when
   it hung from the tray in the picture it was cut from: 40.6cqw from 60cqw
   across, so its cable runs past the card's right edge */
.nic {
  position: relative;
  width: 40.6cqw;
}

.nic > img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 1.5cqw 3cqw rgb(0 0 0 / 0.4));
}

/* The App Executor, a row of its own under the HDD and NIC, centred and as
   tall as the NIC: 18.8cqw, at its picture's 1186 × 821 */
.executor {
  position: relative;
  flex: none;
  width: 27.2cqw;
}

/* Its screen, over the picture's (x 165–1020, y 150–608): terminal lines in
   the frame's cyan, the latest in view */
.executor-screen {
  position: absolute;
  top: 18.3%;
  left: 13.9%;
  width: 72.1%;
  height: 55.8%;
  padding: 0.8cqw 1.2cqw;
  overflow: hidden;
  font: 1.25cqw / 1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.executor-line {
  margin: 0;
  overflow-wrap: anywhere;
  animation: message-in 0.2s ease-out;
}

.executor-command {
  color: #22e3f0;
  text-shadow: 0 0 0.6cqw rgb(34 227 240 / 0.6);
}

.executor-note {
  color: #8fb8e8;
}

.executor-wait {
  color: #fde68a;
}

.executor-pass {
  color: #4ade80;
}

.executor-fail {
  color: #f87171;
}

/* Under it: Back to user, once the action has run, or needs the visitor */
.executor-action {
  top: calc(100% + 1.6cqw);
  left: 50%;
}

.executor > img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 1.5cqw 3cqw rgb(0 0 0 / 0.4));
}

/* Send: a window onto the picture's own pill (x 40-282, y 4-64 of its
   492 × 228), so it can light up and press in */
.nic-send {
  position: absolute;
  top: 1.75%;
  left: 8.13%;
  width: 49.19%;
  height: 26.32%;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: url("../images/nic.webp") 16% 2.381% / 203.31% 380% no-repeat;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.nic-send:hover {
  filter: brightness(1.15) drop-shadow(0 0 1cqw rgb(255 150 60 / 0.7));
}

.nic-send.is-waiting {
  animation: nic-send-pulse 1.4s ease-in-out infinite;
}

@keyframes nic-send-pulse {
  50% {
    filter: brightness(1.2) drop-shadow(0 0 1.6cqw rgb(255 150 60 / 0.9));
  }
}

.nic-send:active {
  filter: brightness(0.9);
  transform: scale(0.96);
}

.nic-send:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* The pulse that runs out along the cable (y 52.6% of the picture), from the
   plug at x 65% to past the card's edge; js/nic.js moves it */
.nic-packet {
  position: absolute;
  top: 52.6%;
  left: 65%;
  width: 4cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff, #7fd8ff 35%, rgb(43 212 255 / 0) 70%);
  opacity: 0;
  pointer-events: none;
  translate: -50% -50%;
}

/* The crane's trolley: a strip the panel's height and the trolley's width,
   in the panel's 1706 × 812 pixels. It starts where the panel's first picture
   had its trolley, x 1160, 208 wide. js/trolley.js runs it along the rail and
   sets --drop, how far the hook hangs below the head, in those pixels. */
.module .trolley {
  --drop: 133;
  top: 0;
  bottom: 0;
  left: 68%;
  width: 12.19%;
}

/* Head on the rail, wheels on it: y 143 to 243 */
.trolley-head {
  top: 17.61%;
  left: 0;
  width: 100%;
  height: auto;
}

/* From y 240, under the head, to 4px into the hook's collar; the cable pays
   out of the drum, so its stripes stay with the hook */
.trolley-cable {
  top: 29.56%;
  left: 45.68%;
  width: 8.46%;
  height: calc((var(--drop) + 4) / 812 * 100%);
  background: url("../images/trolley-cable.webp") 50% 100% / 100% auto no-repeat;
}

.trolley-hook {
  top: calc((240 + var(--drop)) / 812 * 100%);
  left: 22.56%;
  width: 54.89%;
  height: auto;
}

/* The context's blocks, stacked on the context tray's plate (x 1126-1420, top
   y 648 of the panel's 1706 × 812): 290 wide and centred on it, so x 1128-1418,
   up from y 650. The last block in the markup is on top. */
.context-stack {
  position: absolute;
  bottom: 19.91%;
  left: 66.12%;
  width: 17%;
  display: flex;
  flex-direction: column-reverse;
}

/* Where the tools are kept: stacked on the racks' plates (x 187-496 and
   668-960, top y 622), 290 wide and centred on them */
.rack {
  position: absolute;
  bottom: 23.4%;
  width: 17%;
  display: flex;
  flex-direction: column-reverse;
}

.rack-personal {
  left: 11.49%;
}

.rack-project {
  left: 39.21%;
}

/* A block: its tool's picture with its name on it, on a rack or the tray.
   js/context-blocks.js moves a tray's block with transform while the crane
   carries it there. */
.rack-block,
.context-block {
  position: relative;
  aspect-ratio: 640 / 153;
  isolation: isolate;
}

.context-block {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.block-face {
  display: grid;
  place-items: center;
  height: 100%;
  background: url("../images/block-blue.webp") 0 0 / 100% 100%;
  filter: drop-shadow(0 0.6cqw 1cqw rgb(0 0 0 / 0.45));
  color: #ffffff;
  font-size: 1.25cqw;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0.1cqw 0.35cqw rgb(0 0 0 / 0.6);
}

/* Cyan scanlines over the block while it teleports, as on the datacenter's message */
.block-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgb(43 212 255 / 0.9) 0 2px, rgb(43 212 255 / 0.4) 2px 4px);
  mask: url("../images/block-blue.webp") 0 0 / 100% 100%;
  mix-blend-mode: multiply;
  opacity: 0;
  animation: llm-message-scan 0.4s linear infinite;
}

/* Each tool's picture, the chat's being blue. Named outright, not through a
   custom property: some browsers resolve a variable's relative url() against
   the page instead of this stylesheet, and the block goes blank. */
[data-tool="memory"] .block-face {
  background-image: url("../images/block-red.webp");
}

[data-tool="memory"] .block-scan {
  mask-image: url("../images/block-red.webp");
}

[data-tool="rules"] .block-face {
  background-image: url("../images/block-purple.webp");
}

[data-tool="rules"] .block-scan {
  mask-image: url("../images/block-purple.webp");
}

[data-tool="skills"] .block-face {
  background-image: url("../images/block-teal.webp");
}

[data-tool="skills"] .block-scan {
  mask-image: url("../images/block-teal.webp");
}

/* White doesn't read on the light teal */
[data-tool="skills"] .block-face {
  color: var(--page-bg);
  text-shadow: 0 0.1cqw 0.3cqw rgb(255 255 255 / 0.35);
}

.context-block:hover,
.context-block[aria-expanded="true"] {
  filter: brightness(1.15) drop-shadow(0 0 1cqw rgb(127 200 255 / 0.8));
}

.context-block:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* What the clicked block adds, in a bubble like the chat's own to the stack's
   left, its tail pointing at the block; js/context-blocks.js sets its top to
   the block's middle. A line per chat message; long texts scroll. */
.context-bubble {
  position: absolute;
  right: calc(33.88% + 1.6cqw);
  translate: 0 -50%;
  width: max-content;
  max-width: 34cqw;
  border-radius: 1em;
  background: var(--accent);
  color: var(--page-bg);
  font-size: max(10px, 1.6cqw);
  line-height: 1.35;
  animation: message-in 0.3s ease-out;
}

.context-bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  translate: 0 -50%;
  border: 0.9cqw solid transparent;
  border-left-color: var(--accent);
  border-right: 0;
}

.context-bubble p {
  max-height: 20cqw;
  margin: 0;
  padding: 0.45em 0.8em;
  overflow-y: auto;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* The block's name in its colour, as in the datacenter's Received panel, and
   where its text comes from, ruled off from the text itself */
.context-bubble-head {
  display: grid;
  justify-items: start;
  gap: 0.2em;
  padding: 0.55em 0.8em 0.5em;
  border-bottom: 1px solid rgb(0 16 59 / 0.2);
}

.context-bubble-tag {
  margin: 0;
}

.context-bubble-from {
  font-size: 0.82em;
  font-weight: 600;
}

.context-bubble-path {
  padding: 0.1em 0.45em;
  border-radius: 0.35em;
  background: rgb(0 16 59 / 0.14);
  font: 0.78em / 1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* The LLM floats in the datacenter aisle, about where the aisle is as wide as it is */
.llm {
  position: absolute;
  top: 44%;
  left: 50%;
  width: 34%;
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none;
}

.llm-body {
  position: relative;
  height: 100%;
  animation: llm-float 4s ease-in-out infinite;
}

.llm-body img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 2.5cqw rgb(43 212 255 / 0.35));
}

@keyframes llm-float {
  0%,
  100% {
    transform: translateY(-3%) rotate(-1.5deg);
  }
  50% {
    transform: translateY(3%) rotate(1.5deg);
  }
}

/* Its eyes, measured from images/llm.webp: shut, until a message is in front
   of it (js/llm-message.js); then they open and js/llm.js makes them blink */
.llm-eye {
  position: absolute;
  border-radius: 999px;
  background: #fdfdfd;
  scale: 1 0.1;
  transition: scale 0.3s ease-in-out;
}

.llm.is-awake .llm-eye {
  scale: 1;
}

.llm-eye-left {
  top: 47.5%;
  left: 18.27%;
  width: 6.83%;
  height: 13.94%;
}

.llm-eye-right {
  top: 47.4%;
  left: 34.23%;
  width: 6.92%;
  height: 14.04%;
}

/* Its light on the floor below: smaller and brighter as it sinks, wider and
   fainter as it rises */
.llm-glow {
  position: absolute;
  top: 72%;
  left: 50%;
  width: 30%;
  height: 5%;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(43 212 255 / 0.45), transparent);
  animation: llm-glow 4s ease-in-out infinite;
}

@keyframes llm-glow {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1.15);
  }
  50% {
    opacity: 1;
    transform: scale(0.9);
  }
}

/* The message floats in front of the LLM's face, which looks to the left,
   just short of the near edge of its sphere: centred at x 275, y 545 of the
   1086 × 1220 picture. Hidden until js/llm-message.js teleports it in. */
.llm-message {
  position: absolute;
  top: 35.36%;
  left: 17.82%;
  width: 15%;
  opacity: 0;
  isolation: isolate;
  pointer-events: none;
}

/* A button while it waits in front of the LLM: opens what the model received */
.llm-message-body {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  animation: llm-message-float 5s ease-in-out infinite;
}

.llm-message-body:enabled {
  pointer-events: auto;
  cursor: pointer;
}

.llm-message-body:enabled:hover img,
.llm-message-body[aria-expanded="true"] img {
  filter: brightness(1.08) drop-shadow(0 0 1.5cqw rgb(43 212 255 / 0.8));
}

.llm-message-body:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

.llm-message-body img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 1.2cqw 2cqw rgb(0 0 0 / 0.4));
}

@keyframes llm-message-float {
  0%,
  100% {
    transform: translateY(-3%) rotate(-5deg);
  }
  50% {
    transform: translateY(3%) rotate(-3deg);
  }
}

/* The two lines the LLM writes under the page's four, in its own blues and at
   the page's line spacing. In images/message.webp's 400 × 558 pixels: from
   x 42, at y 374 and 429, 29 high. Hidden until written, left to right. */
.llm-message-line {
  position: absolute;
  left: 10.5%;
  height: 5.2%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6b8cff, #3fc8ff);
  clip-path: inset(0 100% 0 0 round 999px);
}

.llm-message-line-1 {
  top: 67.03%;
  width: 74.5%;
}

.llm-message-line-2 {
  top: 76.88%;
  width: 47%;
}

/* Cyan scanlines over the page while it teleports, drifting down */
.llm-message-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgb(43 212 255 / 0.9) 0 2px, rgb(43 212 255 / 0.4) 2px 4px);
  mask: url("../images/message.webp") 0 0 / 100% 100%;
  mix-blend-mode: multiply;
  opacity: 0;
  animation: llm-message-scan 0.4s linear infinite;
}

@keyframes llm-message-scan {
  to {
    background-position: 0 4px;
  }
}

/* A step of the context's trip, as a glowing pill: Look inside on the User
   screen, then Answer and Response in the datacenter */
.step-button {
  position: absolute;
  translate: -50% 0;
  padding: 1.1cqw 3.2cqw;
  border: 1px solid rgb(127 216 255 / 0.7);
  border-radius: 999px;
  background: rgb(10 40 110 / 0.85);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 2cqw rgb(43 212 255 / 0.45);
  color: #e8f8ff;
  font: inherit;
  font-size: max(13px, 2.2cqw);
  font-weight: 700;
  cursor: pointer;
  animation: step-button-in 0.4s ease-out;
  transition: background 0.15s, box-shadow 0.15s;
}

.step-button:hover {
  background: rgb(20 70 160 / 0.9);
  box-shadow: 0 0 3cqw rgb(43 212 255 / 0.7);
}

.step-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

@keyframes step-button-in {
  from {
    opacity: 0;
    translate: -50% 1cqw;
  }
}

/* Under the monitor, on its stand: Look inside, once a message is sent */
.room-action {
  top: 63%;
  left: 61%;
}

/* Under the LLM: Answer once the message has arrived, then Response once the
   LLM has written its output, to send it off */
.llm-action {
  top: 64%;
  left: 50%;
}

/* What the model received: the context, block by block, each tagged in its
   block's colour. Over the aisle's right, beside the message, ending above
   the button under the LLM. */
.received {
  position: absolute;
  top: 8%;
  right: 5%;
  width: 54%;
  max-height: 54%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgb(127 216 255 / 0.45);
  border-radius: 2.4cqw;
  background: rgb(6 18 60 / 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 2cqw 5cqw rgb(0 0 0 / 0.5), 0 0 3cqw rgb(43 212 255 / 0.25);
  font-size: max(11px, 1.8cqw);
  line-height: 1.4;
  animation: message-in 0.3s ease-out;
}

.received[hidden] {
  display: none;
}

/* Phones: below the row of tiles, across the card */
@media (max-width: 600px) {
  .received {
    top: 24%;
    right: 4%;
    width: auto;
    left: 4%;
    max-height: 58%;
  }
}

.received-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 1.6cqw 2cqw 1.2cqw;
}

.received-header h2 {
  margin: 0;
  font-size: 1.1em;
}

.received-close {
  display: grid;
  place-items: center;
  flex: none;
  width: max(24px, 3.6cqw);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: var(--text);
  cursor: pointer;
}

.received-close:hover {
  background: rgb(255 255 255 / 0.16);
}

.received-close svg {
  width: 55%;
}

.received-sections {
  display: grid;
  gap: 1.4cqw;
  padding: 0 2cqw 2cqw;
  overflow-y: auto;
}

/* Block colours, from images/block-*.webp, for the tags here and in the
   Context Builder's bubble. The system prompt has no block: it's the model
   owners', so it's in the LLM's cyan. */
.received-section,
.context-bubble {
  --tag: #0166db;
  --tag-text: #ffffff;
}

:is(.received-section, .context-bubble)[data-tool="system-prompt"] {
  --tag: #2bd4ff;
  --tag-text: var(--page-bg);
}

:is(.received-section, .context-bubble)[data-tool="rules"] {
  --tag: #7231db;
}

:is(.received-section, .context-bubble)[data-tool="skills"] {
  --tag: #02dcd0;
  --tag-text: var(--page-bg);
}

:is(.received-section, .context-bubble)[data-tool="memory"] {
  --tag: #dc304b;
}

.received-section {
  padding-left: 1.4cqw;
  border-left: 0.5cqw solid var(--tag);
}

.received-tag,
.context-bubble-tag {
  display: inline-block;
  margin: 0 0 0.4em;
  padding: 0.15em 0.7em;
  border-radius: 999px;
  background: var(--tag);
  color: var(--tag-text);
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* What the model wrote back, in the blues of its lines on the message, set
   apart from what it received */
.received-section[data-tool="answer"] {
  --tag: #3fc8ff;
  --tag-text: var(--page-bg);
  margin-top: 0.4cqw;
  padding-top: 1.2cqw;
  border-top: 1px dashed rgb(127 216 255 / 0.4);
}

.received-section[data-tool="answer"] .received-tag {
  background: linear-gradient(90deg, #6b8cff, #3fc8ff);
}

/* About how many tokens the whole message takes, under the heading, and
   each section, at the right of its tag */
.received-total {
  margin: 0.15em 0 0;
  color: var(--muted);
  font-size: 0.78em;
  font-variant-numeric: tabular-nums;
}

.received-tokens {
  float: right;
  margin-left: 1em;
  color: var(--muted);
  font-size: 0.75em;
  font-variant-numeric: tabular-nums;
  line-height: 1.9;
}

/* Who put a section there, when it isn't AltGPT */
.received-note {
  margin-left: 0.6em;
  color: var(--muted);
  font-size: 0.75em;
}

.received-section p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* User / Computer / Datacenter switch, top right (bottom centre on phones) */
.views {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgb(127 152 253 / 0.35);
  border-radius: 999px;
  background: rgb(11 26 72 / 0.9);
  backdrop-filter: blur(8px);
}

.views button {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.views button:hover {
  color: var(--text);
}

.views button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--page-bg);
}

@media (max-width: 600px) {
  .views {
    top: auto;
    right: 50%;
    bottom: 16px;
    translate: 50% 0;
  }
}

/* Auto or Manual, in the card's bottom-right corner: a round glassy button
   with just its icon, lit while in auto, and a ring round it that fills up as
   the next press nears */
.autoplay {
  position: absolute;
  right: 2.6cqw;
  bottom: 2.6cqw;
  z-index: 5;
  display: grid;
  place-items: center;
  width: max(40px, 5.4cqw);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 50%;
  background: rgb(6 16 52 / 0.7);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.12);
  color: #dbe4ff;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, scale 0.15s;
}

.autoplay:hover {
  border-color: rgb(255 255 255 / 0.4);
  scale: 1.06;
}

.autoplay:active {
  scale: 0.96;
}

.autoplay[aria-pressed="true"] {
  border-color: rgb(255 255 255 / 0.45);
  background: var(--accent);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.35), 0 0 0 4px rgb(127 152 253 / 0.28);
  color: var(--page-bg);
}

.autoplay:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 6px;
}

.autoplay-icon {
  grid-area: 1 / 1;
  width: 46%;
  height: 46%;
}

/* A play triangle looks centred a touch right of its box's middle */
.autoplay-icon-auto {
  translate: 6% 0;
}

.autoplay[aria-pressed="true"] .autoplay-icon-manual,
.autoplay[aria-pressed="false"] .autoplay-icon-auto {
  display: none;
}

.autoplay-ring {
  position: absolute;
  inset: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  rotate: -90deg;
  pointer-events: none;
}

.autoplay-ring circle {
  fill: none;
  stroke: #4ade80;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

/* Layers cut from the illustration, placed at their pixel boxes in it */
.layer {
  position: absolute;
  pointer-events: none;
}

/* Fades in over the still image once the first moving frame is drawn */
.scene-motion {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s;
}

.scene-motion.is-ready {
  opacity: 1;
}

/* Eases the right hand into and out of its held-down pose while deleting */
.hand {
  transition: transform 80ms ease-out;
}

/* transform-origin is the wrist, under the sleeve */
.hand-left {
  left: 33.15%;
  top: 62.05%;
  width: 8.47%;
  height: 5%;
  transform-origin: 14% 90%;
}

.hand-right {
  left: 36.37%;
  top: 63.03%;
  width: 8.29%;
  height: 7.3%;
  transform-origin: 11% 52%;
}

.foreground {
  left: 30.39%;
  top: 60.82%;
  width: 23.02%;
  height: 11.31%;
}

/* Ellipse covering the eye white in the image: x 292–395, y 553–667 */
.eyelid {
  left: 26.89%;
  top: 45.33%;
  width: 9.48%;
  height: 9.34%;
  border-radius: 50%;
  overflow: hidden;
  /* Rises with the head as he breathes: 2px of the 1086px-wide image at a
     full breath, the head rise baked into images/motion.png */
  translate: 0 calc(var(--breath, 0) * -2 * 100cqw / 1086);
}

/* Skin-coloured lid with a curved edge, parked above the eye until it blinks */
.lid {
  height: 100%;
  border-bottom: max(1px, 0.22cqw) solid #e7812c;
  border-radius: 0 0 50% 50% / 0 0 30% 30%;
  background: #fdb043;
  transform: translateY(-102%);
}

/* Inner monitor screen, measured from the image (1086 × 1220):
   x 427–897, y 396–735, corner radius ~30px.
   Rows: title, chat (collapsed until the first message), composer. */
.screen {
  position: absolute;
  left: 39.32%;
  top: 32.46%;
  width: 43.28%;
  height: 27.79%;
  border-radius: 6.4% / 8.85%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 0fr auto;
  /* One column exactly as wide as the screen, so pictures can't widen it */
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  row-gap: 1.1cqw;
  padding: 0 3.5cqw;
  background: radial-gradient(ellipse at 50% 40%, rgb(127 152 253 / 0.14), transparent 70%);
  transition: grid-template-rows 0.5s ease, row-gap 0.5s ease, padding 0.5s ease;
}

/* After the first message the chat opens up: title on top, composer at the bottom */
.screen.is-chatting {
  grid-template-rows: auto 1fr auto;
  row-gap: 1.2cqw;
  padding-block: 2cqw;
}

.brand {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: max(13px, 3cqw);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  transition: font-size 0.5s ease;
}

.is-chatting .brand {
  font-size: max(10px, 1.7cqw);
}

.brand-mark {
  width: 0.9em;
  height: 0.9em;
  fill: var(--accent);
}

.messages {
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 0.8cqw;
  font-size: max(10px, 1.6cqw);
  line-height: 1.35;
  /* Older messages fade out as they scroll up under the title */
  mask-image: linear-gradient(transparent, #000 1.5cqw);
}

.messages::-webkit-scrollbar {
  display: none;
}

.message {
  max-width: 85%;
  padding: 0.45em 0.8em;
  border-radius: 1em;
  overflow-wrap: anywhere;
  animation: message-in 0.3s ease-out;
}

.message p {
  margin: 0;
}

.from-user {
  align-self: flex-end;
  border-bottom-right-radius: 0.3em;
  white-space: pre-wrap;
  background: var(--accent);
  color: var(--page-bg);
}

.from-ai {
  align-self: flex-start;
  max-width: 92%;
  border-bottom-left-radius: 0.3em;
  background: rgb(255 255 255 / 0.08);
}

.from-ai:has(.pictures) {
  width: 92%;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(0.6em);
  }
}

/* Three bouncing dots while AltGPT "thinks" */
.thinking {
  display: flex;
  gap: 0.3em;
  padding: 0.35em 0;
}

.thinking i {
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--muted);
  animation: thinking 1s ease-in-out infinite;
}

.thinking i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes thinking {
  0%,
  70%,
  100% {
    opacity: 0.35;
    transform: none;
  }
  35% {
    opacity: 1;
    transform: translateY(-0.3em);
  }
}

/* Glowing dot after the last word while a reply streams in */
.is-streaming::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.3em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  animation: pulse 0.8s ease-in-out infinite alternate;
}

@keyframes pulse {
  to {
    opacity: 0.3;
    transform: scale(0.7);
  }
}

.pictures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4em;
  margin-top: 0.5em;
}

.pictures + p {
  margin-top: 0.5em;
}

.pictures figure {
  margin: 0;
  animation: message-in 0.3s ease-out;
}

.pictures canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.5em;
  background: #0a1550;
}

.pictures figcaption,
.swatches figcaption {
  margin-top: 0.25em;
  font-size: 0.8em;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
}

/* Colour chips in a row; a sample shows white text on its colour, as on a button */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 0.5em;
}

.swatches + p {
  margin-top: 0.5em;
}

.swatches figure {
  margin: 0;
  animation: message-in 0.3s ease-out;
}

.swatch {
  display: grid;
  place-items: center;
  min-width: 3.6em;
  height: 2.2em;
  padding: 0 0.9em;
  border-radius: 0.5em;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
}

/* An action in AltGPT's reply: what it does, and how it's going */
.action {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.5em;
  padding: 0.4em 0.6em;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 0.6em;
  background: rgb(255 255 255 / 0.05);
  animation: message-in 0.3s ease-out;
}

.action + p {
  margin-top: 0.5em;
}

.action-icon {
  display: grid;
  flex: none;
  width: 1.3em;
  height: 1.3em;
  color: var(--muted);
}

.action-icon svg {
  width: 100%;
  height: 100%;
}

.action-label {
  font-weight: 600;
}

.action-status {
  flex: none;
  margin-left: auto;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: var(--muted);
  font-size: 0.8em;
  white-space: nowrap;
}

.action[data-state="waiting"] .action-status {
  background: rgb(250 204 21 / 0.18);
  color: #fde68a;
}

.action[data-state="done"] .action-status {
  background: rgb(74 222 128 / 0.16);
  color: #86efac;
}

.action[data-state="denied"] .action-status {
  background: rgb(248 113 113 / 0.16);
  color: #fca5a5;
}

.action[data-state="denied"] .action-label {
  color: var(--muted);
  text-decoration: line-through;
}

/* AltGPT's permission dialog, over the whole monitor, dimming it */
.permission {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 2cqw;
  background: rgb(0 8 40 / 0.55);
  backdrop-filter: blur(2px);
  font-size: max(10px, 1.6cqw);
  line-height: 1.35;
}

.permission[hidden] {
  display: none;
}

.permission-card {
  width: min(100%, 26em);
  padding: 1em 1.1em;
  border: 1px solid rgb(127 152 253 / 0.45);
  border-radius: 1em;
  background: #0b1a48;
  box-shadow: 0 1.5cqw 4cqw rgb(0 0 0 / 0.5);
  text-align: center;
  animation: permission-in 0.25s ease-out;
}

@keyframes permission-in {
  from {
    opacity: 0;
    scale: 0.94;
  }
}

.permission-icon {
  width: 2em;
  height: 2em;
  color: #facc15;
}

.permission-title {
  margin: 0.2em 0;
  font-size: 1.1em;
  font-weight: 700;
}

.permission-text {
  margin: 0;
}

.permission-buttons {
  display: flex;
  gap: 0.6em;
  margin-top: 0.9em;
}

.permission-buttons button {
  flex: 1;
  padding: 0.5em 1em;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.permission-deny {
  background: rgb(255 255 255 / 0.12);
  color: var(--text);
}

.permission-allow {
  background: var(--accent);
  color: var(--page-bg);
}

.permission-buttons button:hover {
  filter: brightness(1.15);
}

.permission-buttons button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Phones: the monitor is small, so the dialog drops its icon and tightens up
   to fit on it */
@media (max-width: 600px) {
  .permission {
    padding: 1cqw;
    font-size: max(8px, 1.6cqw);
  }

  .permission-card {
    padding: 0.6em 0.7em;
  }

  .permission-icon {
    display: none;
  }

  .permission-title {
    margin-top: 0;
  }

  .permission-buttons {
    margin-top: 0.5em;
  }

  .permission-buttons button {
    padding: 0.35em 0.6em;
  }
}

/* Someone else's message, slid in at the monitor's top right, light as a
   system notification */
.toast {
  position: absolute;
  top: 1.5cqw;
  right: 1.5cqw;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  max-width: 70%;
  padding: 0.6em 0.8em;
  border-radius: 0.8em;
  background: rgb(245 247 255 / 0.96);
  box-shadow: 0 1cqw 2.5cqw rgb(0 0 0 / 0.45);
  color: #0b1a48;
  font-size: max(9px, 1.35cqw);
  line-height: 1.3;
  animation: toast-in 0.35s ease-out;
}

.toast[hidden] {
  display: none;
}

@keyframes toast-in {
  from {
    opacity: 0;
    translate: 2cqw 0;
  }
}

.toast p {
  margin: 0;
}

.toast-from {
  display: block;
}

.toast-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.8em;
  height: 1.8em;
  border-radius: 0.45em;
  background: #7c3aed;
  color: #ffffff;
  font-weight: 800;
}

/* Starts each scenario's conversation, below the faded top edge */
.new-chat {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin: 1.2cqw 0 0;
  color: var(--muted);
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: message-in 0.3s ease-out;
}

.new-chat::before,
.new-chat::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgb(127 152 253 / 0.3);
}

/* Rounded like a pill while it's one line, a rounded box as it grows; Send
   stays by the last line */
.composer {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 0.9cqw;
  padding: 0.65cqw 0.65cqw 0.65cqw 2cqw;
  border: 1px solid rgb(127 152 253 / 0.35);
  border-radius: 1.35em;
  background: rgb(255 255 255 / 0.06);
  font-size: max(12px, 2.1cqw);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(127 152 253 / 0.2);
}

/* Grows with its text (js/chat.js), up to four lines, then scrolls */
.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: calc(4lh + 0.8em);
  padding: 0.4em 0;
  border: 0;
  outline: 0;
  overflow-y: auto;
  scrollbar-width: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.35;
}

.composer textarea::placeholder {
  color: var(--muted);
}

/* Centred on the field's last line: a line and its padding are 2.15 times
   the composer's text size */
.composer button {
  flex: none;
  display: grid;
  place-items: center;
  width: max(22px, 3.7cqw);
  aspect-ratio: 1;
  margin-bottom: calc((max(12px, 2.1cqw) * 2.15 - max(22px, 3.7cqw)) / 2);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--page-bg);
  cursor: pointer;
}

.composer button:disabled {
  opacity: 0.4;
  cursor: default;
}

.composer button svg {
  width: 55%;
  height: 55%;
}

/* A thin strip along the screen's bottom edge: touching it brings up the dock.
   Thinner than the padding under the composer, so it never covers it. */
.dock-zone {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 1.6cqw;
}

/* Mac-style dock: parked below the screen's edge, slides up while the pointer
   is on the strip or on the dock, and goes away a moment after it leaves */
.dock {
  position: absolute;
  bottom: 0.8cqw;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 0.8cqw;
  padding: 0.6cqw 0.8cqw;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 1.6cqw;
  background: rgb(255 255 255 / 0.12);
  backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 0.8cqw 2.4cqw rgb(0 0 0 / 0.35);
  translate: -50% 160%;
  transition: translate 0.25s ease 0.3s;
}

.dock-zone:hover + .dock,
.dock:hover,
.dock:has(:focus-visible) {
  translate: -50% 0;
  transition-delay: 0s;
}

.dock-app {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform 0.15s ease;
}

/* Magnify the app under the pointer, and its neighbour a little */
.dock-app:hover,
.dock-app:focus-visible {
  transform: scale(1.12);
}

.dock-app:has(+ .dock-app:hover),
.dock-app:hover + .dock-app {
  transform: scale(1.04);
}

.dock-app:focus-visible {
  outline: none;
}

.dock-icon {
  display: grid;
  place-items: center;
  width: max(20px, 4.4cqw);
  aspect-ratio: 1;
  border-radius: 22%;
  color: #ffffff;
  box-shadow: 0 0.3cqw 0.8cqw rgb(0 0 0 / 0.3);
}

.dock-icon svg {
  width: 58%;
  height: 58%;
}

.dock-icon-code {
  background: linear-gradient(160deg, #3aa8f0, #0b6fc2);
}

.dock-icon-altgpt {
  background: linear-gradient(145deg, #a58bff, #3b5bdb 55%, #2bd4ff);
}

/* Dot under an app that is open */
.dock-app.is-running::after {
  content: "";
  position: absolute;
  bottom: -0.45cqw;
  left: 50%;
  width: max(3px, 0.35cqw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.85);
  translate: -50% 0;
}

/* App name above the app under the pointer */
.dock-label {
  position: absolute;
  bottom: calc(100% + 0.7cqw);
  left: 50%;
  padding: 0.25em 0.6em;
  border-radius: 0.4em;
  background: rgb(20 24 48 / 0.92);
  color: #ffffff;
  font-size: max(9px, 1.2cqw);
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  translate: -50% 0;
  transition: opacity 0.12s;
}

.dock-app:hover .dock-label,
.dock-app:focus-visible .dock-label {
  opacity: 1;
}

/* AltIDE: its window fills the screen, over AltGPT's chat, while it is the
   app in front */
.ide {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #0a2a86, #011a58 70%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.screen[data-app="ide"] .ide {
  opacity: 1;
  visibility: visible;
}

/* The size container for its title, so cqw below is a share of its width */
.ide-window {
  position: relative;
  width: 92%;
  aspect-ratio: 1000 / 658;
  container-type: inline-size;
  transform: scale(0.94);
  transition: transform 0.25s ease;
}

.screen[data-app="ide"] .ide-window {
  transform: none;
}

.ide-window img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1.5cqw 3cqw rgb(0 0 0 / 0.45));
}

/* Where the picture's own title was: mark at x 2.6%, text from x 11.7%,
   centred 14% down */
.ide-title {
  position: absolute;
  top: 14%;
  left: 2.6%;
  display: flex;
  align-items: center;
  gap: 3.5cqw;
  margin: 0;
  color: #ffffff;
  font-size: 6.3cqw;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  translate: 0 -50%;
}

.ide-mark {
  display: grid;
  place-items: center;
  width: 5.6cqw;
  aspect-ratio: 1;
  border-radius: 22%;
  background: linear-gradient(160deg, #3aa8f0, #0b6fc2);
}

.ide-mark svg {
  width: 62%;
  height: 62%;
}

/* The project's files, over the picture's list (x 20–305, y 196–632 of its
   1000 × 658), indented by depth; new ones slide in, the open one is lit */
.ide-files {
  position: absolute;
  top: 29.8%;
  left: 2%;
  width: 28.5%;
  height: 66.3%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  background: #011341;
  color: #dbe4ff;
  font-size: 2.15cqw;
}

.ide-file {
  display: flex;
  align-items: center;
  gap: 0.7cqw;
  height: 3.3cqw;
  padding: 0 0.8cqw 0 calc(0.8cqw + var(--depth) * 1.5cqw);
  border-radius: 0.8cqw;
  white-space: nowrap;
}

.ide-file.is-new {
  animation: ide-file-in 0.35s ease-out;
}

.ide-file.is-open {
  background: rgb(127 152 253 / 0.22);
  color: #ffffff;
}

@keyframes ide-file-in {
  from {
    opacity: 0;
    translate: -2cqw 0;
  }
}

.ide-chevron {
  flex: none;
  width: 1.6cqw;
  height: 1.6cqw;
  color: #8fa3e6;
  transition: rotate 0.2s ease;
}

.ide-file.is-expanded .ide-chevron {
  rotate: 90deg;
}

.ide-icon {
  flex: none;
  width: 2.6cqw;
  height: 2.6cqw;
}

.ide-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The file being edited, over the picture's editor and terminal (x 326–990,
   y 135–643), drawn like its panels: a tab with the file's name, then the
   text with line numbers, following the caret */
.ide-editor {
  position: absolute;
  top: 20.5%;
  left: 32.6%;
  width: 66.4%;
  height: 77.2%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 0.3cqw solid #1135bf;
  border-radius: 2cqw;
  overflow: hidden;
  background: #00113d;
  color: #dbe4ff;
}

.ide-editor[hidden] {
  display: none;
}

.ide-tab {
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  margin: 0;
  padding: 1.3cqw 2.2cqw;
  background: #011b69;
  color: #ffffff;
  font-size: 2.7cqw;
  font-weight: 600;
}

.ide-tab-icon svg {
  display: block;
  width: 3cqw;
  height: 3cqw;
}

.ide-tab-state {
  margin-left: auto;
  color: #8fa3e6;
  font-size: 0.8em;
  font-weight: 500;
}

.ide-code {
  overflow: hidden;
  padding: 1.2cqw 2cqw 1.2cqw 0;
  counter-reset: line;
  font: 2.15cqw / 1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ide-line {
  position: relative;
  min-height: 1.5em;
  padding-left: 6cqw;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ide-line::before {
  content: counter(line);
  counter-increment: line;
  position: absolute;
  left: 0;
  width: 4cqw;
  color: #6f82c4;
  text-align: right;
}

.ide-heading {
  color: #f472d0;
  font-weight: 700;
}

.ide-key {
  color: #22d3ee;
}

.ide-bullet {
  color: #facc15;
}

.ide-fence {
  color: #6f82c4;
}

.ide-string {
  color: #86efac;
}

.ide-value {
  color: #fdba74;
}

/* The line AltGPT is changing */
.ide-line.is-editing {
  background: rgb(127 152 253 / 0.18);
}

.ide-caret {
  display: inline-block;
  width: 0.15em;
  height: 1.15em;
  margin-left: 0.05em;
  background: #ffffff;
  vertical-align: text-bottom;
}
