/* The hero: the mark, the headline, and the app's window playing a recorded chat (js/window.js), its sidebar, chat and
   computer drawn after the app's own (sidebars.bdeb2397: sidebar, chat-ui, chatview), with the four chats' tabs under it. */
.hero { padding-block: var(--sp-32) var(--sp-96); text-align: center; }
.hero-mark { display: block; width: 184px; height: 184px; margin: calc(-1 * var(--sp-24)) auto calc(-1 * var(--sp-40)); opacity: 0; transition: opacity var(--d-deliberate) var(--ease-std); /* deliberate */ }
.hero-mark.is-live { opacity: 1; }
.hero-mark > * { width: 100%; height: 100%; }
.hero h1 { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--tr-display); font-weight: 700; }
.hero .lede { margin: var(--sp-24) auto 0; max-width: 56ch; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-12); margin-top: var(--sp-32); }
.win-wrap { margin-top: var(--sp-64); text-align: left; }

/* ---------- the window ---------- */
.win {
  --tint: var(--ink);
  display: grid; grid-template-columns: 212px minmax(0, 1fr) minmax(0, 1.22fr);
  grid-template-rows: minmax(0, 1fr); /* the columns stay the window's height, so the chat and steps scroll inside it */
  height: 660px;
  background: var(--surface);
  border: var(--hair) solid var(--sel); border-radius: var(--r-surf);
  box-shadow: var(--lift);
  overflow: hidden;
  font-size: var(--fs-small); line-height: var(--lh-small);
}

/* the sidebar */
.win-sb { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-12) var(--sp-8); background: var(--ground); border-right: var(--hair) solid var(--sel); min-width: 0; }
.win-sb-top { display: flex; align-items: center; gap: var(--sp-8); height: 36px; padding: 0 var(--sp-6); margin-bottom: var(--sp-8); }
.win-sb-top sb-mark { width: 24px; height: 24px; }
.win-sb-top sb-mark > * { width: 100%; height: 100%; }
.win-sb-top b { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.win-row { display: flex; align-items: center; gap: var(--sp-12); height: 30px; padding: 0 var(--sp-8); border-radius: var(--r-ctl); white-space: nowrap; overflow: hidden; }
.win-row span { overflow: hidden; text-overflow: ellipsis; }
.win-row .fx { width: var(--ic-s); height: var(--ic-s); }
.win-row.is-on { background: var(--sel); }
.win-row.is-working .fx { animation: win-turn 2.8s linear infinite; /* deliberate */ }
@keyframes win-turn { to { transform: rotateY(1turn); } }
.win-sb-h { padding: var(--sp-16) var(--sp-8) var(--sp-6); font-size: var(--fs-tiny); color: var(--muted); }
.win-sb-foot { display: flex; align-items: center; gap: var(--sp-8); margin-top: auto; padding: var(--sp-8); border-top: var(--hair) solid var(--sel); font-variant-numeric: tabular-nums; }
.win-sb-foot .fx { width: 18px; height: 18px; }

/* the chat */
.win-chat { display: flex; flex-direction: column; min-width: 0; border-right: var(--hair) solid var(--sel); }
.win-feed { position: relative; flex: 1; min-height: 0; overflow: hidden; padding: var(--sp-20) var(--sp-20) 0; }
.win-feed::after { content: ""; position: absolute; inset: 0 0 auto; height: var(--sp-20); background: linear-gradient(var(--surface), transparent); pointer-events: none; }
.win-feed-in { display: grid; gap: var(--sp-16); padding-bottom: var(--sp-16); transition: transform var(--d-slow) var(--ease-std); }
.cm-u { justify-self: end; max-width: 86%; padding: var(--sp-8) var(--sp-12); background: var(--ground); border-radius: var(--r-surf); }
.cm-b { display: grid; gap: var(--sp-8); }
.cm-w { opacity: 0; transition: opacity var(--d-fast) var(--ease-std); }
.cm-w.on { opacity: 1; }
.cm-card { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-12); padding: var(--sp-8); border: var(--hair) solid var(--sel); border-radius: var(--r-ctl); }
.cm-card.is-win { border-color: color-mix(in srgb, var(--win) 45%, var(--sel)); }
.cm-thumb { display: grid; place-items: center; aspect-ratio: 3 / 2; background: var(--ground); border-radius: var(--r-ctl); overflow: hidden; }
.cm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cm-thumb .fx { width: 36px; height: 36px; object-fit: contain; }
.cm-card-t { display: grid; min-width: 0; }
.cm-card-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-card-t small, .cm-card-p small { font-size: var(--fs-tiny); color: var(--muted); line-height: 1.4; }
.cm-card-p { display: grid; justify-items: end; text-align: right; }
.cm-card-p b { display: inline-flex; align-items: center; gap: var(--sp-6); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.cm-card-p .fx { width: 20px; height: 20px; }
.cm-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-8); }
.cm-strip figure { margin: 0; display: grid; gap: var(--sp-4); }
.cm-strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-ctl); }
.cm-strip figcaption { font-size: var(--fs-tiny); color: var(--muted); }
.cm-after { color: var(--ink); }

/* the run report: before and after, the steps that mattered, what the run counted, and the next run */
.rr { display: grid; gap: var(--sp-12); padding: var(--sp-12); border: var(--hair) solid var(--sel); border-radius: var(--r-ctl); }
.rr-h { display: flex; align-items: center; gap: var(--sp-8); }
.rr-h img { width: 20px; height: 20px; }
.rr-h span { margin-left: auto; color: var(--muted); font-size: var(--fs-tiny); }
.rr-strip { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12); background: var(--ground); border-radius: var(--r-ctl); }
.rr-v { display: grid; flex: 1; min-width: 0; }
.rr-v small { font-size: var(--fs-tiny); color: var(--muted); }
.rr-v b { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rr-v.is-after b { color: var(--win); }
.rr-arrow { width: var(--ic-s); height: var(--ic-s); flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rr-lines { display: grid; gap: var(--sp-6); }
.rr-lines li { display: flex; align-items: center; gap: var(--sp-8); }
.rr-lines .fx { width: var(--ic-s); height: var(--ic-s); }
.rr-counts { display: flex; gap: var(--sp-16); font-size: var(--fs-tiny); color: var(--muted); }
.rr-counts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rr-next { display: flex; align-items: center; gap: var(--sp-8); padding-top: var(--sp-12); border-top: var(--hair) solid var(--sel); font-weight: 500; }
.rr-next .fx { width: 18px; height: 18px; }
.rr-ghost { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-8) var(--sp-12); border: var(--hair) dashed var(--sel); border-radius: var(--r-ctl); color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* the composer */
.win-comp { margin: 0 var(--sp-16) var(--sp-16); padding: var(--sp-12) var(--sp-12) var(--sp-8); border: var(--hair) solid var(--sel); border-radius: var(--r-surf); }
.win-field { min-height: 40px; padding: 0 var(--sp-4); }
.win-hint { color: var(--muted); }
.win-caret { display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; vertical-align: -0.15em; background: var(--ink); opacity: 0; }
.win-comp.is-typing .win-caret { opacity: 1; animation: win-blink 1s steps(1) infinite; /* deliberate */ }
.win-comp.is-typing .win-hint { display: none; }
@keyframes win-blink { 50% { opacity: 0; } }
.win-tools { display: flex; align-items: center; gap: var(--sp-6); }
.win-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); }
.win-ic svg { width: var(--ic-s); height: var(--ic-s); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.win-effort { display: inline-flex; align-items: center; gap: var(--sp-4); margin-left: auto; padding: 0 var(--sp-8); height: 28px; color: var(--muted); }
.win-effort img { width: 20px; height: 20px; }
.win-effort svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.win-send { background: var(--sel); color: var(--surface); transition: background-color var(--d-fast) var(--ease-std), transform var(--d-fast) var(--ease-std); }
.win-comp.is-ready .win-send { background: var(--ink); }
.win-send.is-press { transform: scale(0.88); }

/* the computer */
.win-cc { display: flex; flex-direction: column; min-width: 0; }
.win-cc-top { display: flex; justify-content: flex-end; gap: var(--sp-4); height: 40px; align-items: center; padding: 0 var(--sp-8); }
.win-frame { position: relative; margin: 0 var(--sp-12); border-radius: var(--r-ctl); overflow: hidden; background: var(--ground); border: var(--hair) solid var(--sel); }
.win-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tint) 70%, transparent), inset 0 0 28px color-mix(in srgb, var(--tint) 45%, transparent);
  opacity: 0; transition: opacity var(--d-slow) var(--ease-std);
}
.win-frame.is-control::after { opacity: 1; }
.win-bar { display: flex; align-items: flex-end; gap: var(--sp-8); height: 26px; padding: 0 var(--sp-8); }
.win-dots { display: flex; gap: 5px; align-self: center; }
.win-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--sel); }
.win-tab { display: flex; align-items: center; gap: var(--sp-6); max-width: 220px; height: 22px; padding: 0 var(--sp-8); background: var(--surface); border-radius: var(--r-ctl) var(--r-ctl) 0 0; font-size: var(--fs-tiny); }
.win-tab img { width: 12px; height: 12px; }
.win-tab span, .win-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-url { display: flex; align-items: center; gap: var(--sp-4); height: 26px; padding: 0 var(--sp-12); background: var(--surface); font-size: var(--fs-tiny); color: var(--muted); }
.win-url svg { width: 11px; height: 11px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.win-host { color: var(--ink); }
.win-tab, .win-url span { transition: opacity var(--d-fast) var(--ease-std); }
.win-page { position: relative; aspect-ratio: 1470 / 837; overflow: hidden; background: var(--surface); }
.win-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; opacity: 0; transition: opacity 220ms var(--ease-std); }
.win-shot.is-on { opacity: 1; }
.win-cursor { position: absolute; left: 0; top: 0; z-index: 2; width: 16px; height: 22px; opacity: 0; transition: opacity var(--d-base) var(--ease-std); filter: drop-shadow(0 1px 2px var(--scrim)); }
.win-frame.is-control .win-cursor { opacity: 1; }
.win-cursor svg { width: 100%; height: 100%; }
.win-cursor path { fill: var(--ink); stroke: var(--surface); stroke-width: 1.4; stroke-linejoin: round; }
.win-stop { position: absolute; left: 50%; bottom: var(--sp-12); z-index: 3; display: inline-flex; align-items: center; gap: var(--sp-6); padding: var(--sp-6) var(--sp-12); border-radius: var(--r-pill); background: var(--ink); color: var(--surface); font-size: var(--fs-tiny); font-weight: 600; transform: translate(-50%, 8px); opacity: 0; transition: opacity var(--d-base) var(--ease-std), transform var(--d-base) var(--ease-std); }
.win-stop i { width: 8px; height: 8px; border-radius: 2px; background: var(--surface); }
.win-frame.is-control .win-stop { opacity: 1; transform: translate(-50%, 0); }
.win-steps { position: relative; flex: 1; min-height: 0; overflow: hidden; padding: var(--sp-12) var(--sp-16); }
.win-steps-in { display: grid; transition: transform var(--d-slow) var(--ease-std); }
.win-step { display: flex; align-items: center; gap: var(--sp-12); min-height: 32px; white-space: nowrap; }
.win-step span { overflow: hidden; text-overflow: ellipsis; }
.win-step .fx { width: 18px; height: 18px; }
.win-step.is-now { color: var(--muted); }
.win-step.is-win { font-weight: 600; }
.win-empty { color: var(--muted); }

/* the chats' tabs */
.demo-tabs { display: flex; justify-content: center; gap: var(--sp-8); margin-top: var(--sp-24); }
.demo-tab {
  display: inline-flex; align-items: center; gap: var(--sp-8);
  min-height: var(--tap); padding: 0 var(--sp-16) 0 var(--sp-12);
  background: transparent; border: var(--hair) solid transparent; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap;
  transition: background-color var(--d-fast) var(--ease-std), color var(--d-fast) var(--ease-std), border-color var(--d-fast) var(--ease-std);
}
.demo-tab:hover { color: var(--ink); }
.demo-tab[aria-selected="true"] { background: var(--surface); border-color: var(--sel); color: var(--ink); }
.demo-tab .fx { width: var(--ic-m); height: var(--ic-m); }

@media (max-width: 1080px) {
  .win { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .win-sb { display: none; }
}
@media (max-width: 760px) {
  .hero-mark { width: 144px; height: 144px; }
  .win-wrap { margin-top: var(--sp-48); }
  .win { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; height: auto; }
  .win-cc { order: -1; border-bottom: var(--hair) solid var(--sel); }
  .win-cc-top { display: none; }
  .win-frame { margin: var(--sp-8); }
  .win-steps { flex: none; height: 104px; padding-block: var(--sp-4) var(--sp-8); }
  .win-chat { height: 380px; border-right: 0; }
  .win-feed { padding: var(--sp-16) var(--sp-16) 0; }
  .win-comp { margin: 0 var(--sp-8) var(--sp-8); }
  .win-effort span { display: none; }
  .demo-tabs { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .demo-tabs::-webkit-scrollbar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mark, .win-feed-in, .win-steps-in, .win-shot, .win-cursor, .win-stop, .win-frame::after, .cm-w, .win-send, .win-tab, .win-url span { transition: none; }
  .win-row.is-working .fx, .win-comp.is-typing .win-caret { animation: none; }
}
