/*
 * terminal6.css: the mini Playground terminal (see terminal6.js).
 * Values are the dashboard Playground's as rendered at localhost:3000
 * (calm-tokens.css after the elevate dials): Inter 14/20, actor column 92px,
 * shaded 4px transcript cards, a 6px hairline card around it all.
 * Everything is scoped under .t6 so it cannot leak into the host page.
 */
.t6 {
  --t6-bg: #ffffff;
  --t6-subtle: #f4f4f3;
  --t6-line: #ececea;
  --t6-line-2: #dad8d3;
  --t6-text: #161514;
  --t6-text-2: #6e6d6a;
  --t6-text-3: #a2a19d;
  --t6-accent: #e2703f;
  --t6-accent-hover: #cc6134;
  --t6-nav-active: #eaeae8;
  --t6-warn: #aa542a;
  --t6-shadow: 0 8px 32px rgba(27, 26, 23, 0.08);
  --t6-h: 560px;

  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: var(--t6-h);
  box-sizing: border-box;
  background: var(--t6-bg);
  border: 1px solid var(--t6-line);
  border-radius: 6px;
  color: var(--t6-text);
  /* v6 round 2: the landing page's own sans (Google Fonts Inter + the page's cv11/ss01), so card and hero read as one family */
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  text-align: left;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}
.t6 *,
.t6 *::before,
.t6 *::after {
  box-sizing: border-box;
}
.t6 p {
  margin: 0;
}
.t6 button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.t6 button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--t6-accent) 45%, transparent);
  outline-offset: 2px;
}

/* ── header: case switch left, replay right ─────────────────────────────── */
.t6-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 16px 0 24px;
  border-bottom: 1px solid var(--t6-line);
}
.t6-switch {
  position: relative;
  min-width: 0;
}
.t6-switch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  max-width: 100%;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--t6-text);
}
.t6-switch-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.t6-chev {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--t6-text-2);
}
.t6-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: -8px;
  width: 300px;
  max-width: calc(100cqw - 16px);
  padding: 4px;
  background: var(--t6-bg);
  border: 1px solid var(--t6-line);
  border-radius: 6px;
  box-shadow: var(--t6-shadow);
}
.t6-menu[hidden] {
  display: none;
}
.t6 .t6-opt {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--t6-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.12s;
}
.t6 .t6-opt:hover,
.t6 .t6-opt:focus-visible {
  background: var(--t6-subtle);
  outline: none;
}
.t6 .t6-opt.is-on {
  background: var(--t6-nav-active);
}
.t6 .t6-replay {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--t6-text-2);
  transition: color 0.12s, background-color 0.12s;
}
.t6 .t6-replay:hover {
  color: var(--t6-text);
  background: var(--t6-subtle);
}
.t6-replay-ico {
  width: 14px;
  height: 14px;
}

/* ── the transcript ─────────────────────────────────────────────────────── */
.t6-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 24px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--t6-line-2) transparent;
}
/* touch screens: a swipe on the transcript scrolls it to its end, then the page carries on.
   `contain` stays for mouse and trackpad, where it keeps the wheel from running on into the page. */
@media (hover: none), (pointer: coarse) {
  .t6-log {
    overscroll-behavior: auto;
  }
}
.t6-log:focus-visible {
  outline: none;
}
.t6-entry {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);   /* narrow actor column: the flow gets the width */
  gap: 12px;
  padding: 8px 0;
  animation: t6-reveal 0.18s ease-out;
}
.t6-actor {
  padding-top: 2px;
  font-size: 11.5px;
  line-height: 16px;
  overflow-wrap: anywhere;
  color: var(--t6-text-2);
}
.t6-actor.is-same {
  visibility: hidden;
}
.t6-body {
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
}
.t6-prompt,
.t6-you {
  color: var(--t6-text);
}
.t6-think,
.t6-note {
  color: var(--t6-text-2);
}
.t6-dots {
  display: inline-block;
  width: 1.1em;
  text-align: left;
}
.t6-caret {
  display: inline-block;
  width: 1px;
  height: 14px;
  margin-left: 1px;
  background: var(--t6-text);
  vertical-align: -2px;
  animation: t6-caret 1s steps(2) infinite;
}
.t6-caret.is-sm {
  height: 12px;
  vertical-align: -1px;
}

/* the shaded card: a command, Kite's checks, its one-line verdicts */
.t6-card {
  border-radius: 4px;
  background: var(--t6-subtle);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--t6-text);
}
.t6-callrow {
  display: flex;
  align-items: center;
  gap: 10px;
}
.t6-code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 16px;
  overflow-wrap: anywhere;
}
.t6-spin {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--t6-accent);
  animation: t6-pulse 0.7s ease-in-out infinite alternate;
}
.t6-out {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 18px;
  color: var(--t6-text-2);
}
.t6-out-l {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.t6-rise {
  animation: t6-reveal 0.18s ease-out;
}
.t6-skip {
  font-size: 13px;
  color: var(--t6-text-3);
}
.t6-skip-2 {
  margin-left: 10px;
}
.t6-check {
  display: inline-grid;
  grid-template-columns: auto auto;
  column-gap: 22px;
  row-gap: 3px;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
}
.t6-k {
  color: var(--t6-text-2);
}
.t6-v {
  white-space: pre;
  color: var(--t6-text);
}
.t6-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  padding: 7px 12px;
  white-space: nowrap;
}
.t6-glyph {
  font-size: 11px;
  color: var(--t6-text-2);
}
.t6-quiet {
  color: var(--t6-text-2);
}
.t6-line.is-stop,
.t6-line.is-stop .t6-glyph,
.t6-line.is-stop .t6-quiet {
  color: var(--t6-warn);
}

/* the result: a heading and its rows off a 2px rule */
.t6-result {
  border-left: 2px solid var(--t6-line-2);
  padding: 2px 0 2px 12px;
}
.t6-result-h {
  font-weight: 500;
  color: var(--t6-text);
}
.t6-rows {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  font-size: 13px;
}
.t6-rrow {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(90px, 0.8fr) minmax(110px, 1fr);
  gap: 16px;
}
.t6-c0 {
  color: var(--t6-text);
}
.t6-c1,
.t6-c2 {
  color: var(--t6-text-2);
}
.t6 .t6-raise {
  display: inline-flex;
  align-items: center;
  height: 36px;
  margin-top: 10px;
  padding: 0 16px;
  border-radius: 0;
  background: var(--t6-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.12s;
}
.t6 .t6-raise:hover {
  background: var(--t6-accent-hover);
}

/* Learn: a step's opening rule */
.t6-chapter {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);   /* narrow actor column: the flow gets the width */
  gap: 12px;
  margin-top: 16px;
  padding: 20px 0 4px;
  border-top: 1px solid var(--t6-line);
  font-size: 12px;
  animation: t6-reveal 0.18s ease-out;
}
.t6-chapter.is-first {
  margin-top: 0;
  padding-top: 4px;
  border-top: 0;
}
.t6-step {
  color: var(--t6-text-3);
}
.t6-step-name {
  font-weight: 500;
  color: var(--t6-text-2);
}

/* ── narrower cards (the dashboard's under-1000 / under-760 steps) ──────── */
@container (max-width: 640px) {
  .t6-rrow {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
    column-gap: 12px;
    row-gap: 4px;
  }
  .t6-c2 {
    grid-column: 1 / -1;
  }
}
@container (max-width: 560px) {
  .t6-head {
    padding: 0 8px 0 16px;
  }
  .t6-log {
    padding: 12px 16px 28px;
  }
  .t6-entry,
  .t6-chapter {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px;
  }
  .t6-entry {
    padding: 7px 0;
  }
  .t6-actor {
    font-size: 11px;
  }
  .t6-card {
    display: flex;
  }
  .t6-check {
    display: grid;
  }
  .t6-line {
    white-space: normal;
  }
  .t6-rrow {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 3px 0;
    border-bottom: 1px solid var(--t6-line);
  }
  .t6-c2 {
    grid-column: auto;
  }
  .t6-replay span {
    display: none;
  }
}
@media (max-width: 480px) {
  .t6 {
    --t6-h: 520px;
  }
}

@keyframes t6-reveal {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes t6-caret {
  to {
    opacity: 0;
  }
}
@keyframes t6-pulse {
  to {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .t6-entry,
  .t6-chapter,
  .t6-rise,
  .t6-caret,
  .t6-spin {
    animation: none;
  }
  .t6-log {
    scroll-behavior: auto;
  }
}

/* ── home screen: every case as a row; pick one to play it ─────────────── */
.t6 .t6-replay[hidden] {
  display: none;
}
.t6 .t6-opt-home {
  color: var(--t6-text-2);
}
.t6-home {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -12px;
}
.t6 .t6-home-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  text-align: left;
  color: var(--t6-text);
  opacity: 0;
  animation: t6-home-in 0.32s ease-out forwards;
  animation-delay: calc(var(--i) * 40ms);
  transition: background-color 0.12s;
}
.t6 .t6-home-row:hover,
.t6 .t6-home-row:focus-visible {
  background: var(--t6-subtle);
  outline: none;
}
.t6-home-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.t6-home-t {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}
.t6-home-l {
  font-size: 13px;
  line-height: 1.4;
  color: var(--t6-text-2);
}
.t6-home-go {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--t6-text-3);
  transform: rotate(-90deg);
  transition: color 0.12s, transform 0.12s;
}
.t6 .t6-home-row:hover .t6-home-go {
  color: var(--t6-text);
  transform: rotate(-90deg) translateY(2px);
}
@keyframes t6-home-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .t6 .t6-home-row { animation: none; opacity: 1; }
}
