/* Scripted assistant demo — a terminal in the house palette.
 *
 * Warm charcoal rather than black, brass hairlines, one Ferrari red accent on the caret and
 * the send sigil. Sized so a whole answer fits without the page jumping as lines stream in.
 */

.demo-term {
  background: var(--color-surface-dark, #1E1915);
  border: 1px solid rgba(166, 129, 63, 0.28);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(27, 23, 18, 0.22);
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  max-width: 940px;
  margin: 0 auto;
}

/* Title bar */
.demo-term__chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(166, 129, 63, 0.22);
}
.demo-term__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.demo-term__dot--a { background: #A81E22; }
.demo-term__dot--b { background: #A6813F; }
.demo-term__dot--c { background: #4b433a; }
.demo-term__title {
  margin-left: 0.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: #A6813F;
}

/* Screen */
.demo-term__screen {
  padding: 1.15rem 1.25rem 1.35rem;
  min-height: 22rem;
  color: #EFE7D9;
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* Height lock. The ghost layer holds the finished transcript in normal flow and so
   sets the screen's height; it is hidden but still measured, and it re-measures by
   itself when the viewport changes (phone rotation, URL bar showing and hiding).
   The live layer — the one that types and streams — is lifted out of flow on top of
   it, so nothing that happens during playback can move the rest of the page. */
.demo-term__stack { position: relative; }
.demo-term__layer--ghost { visibility: hidden; }
.demo-term__layer--live { position: absolute; top: 0; left: 0; right: 0; }

.demo-term__prompt {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(166, 129, 63, 0.18);
  flex-wrap: wrap;
}
.demo-term__sigil { color: #A81E22; font-weight: 700; }
.demo-term__typed { color: #FBF8F1; }
.demo-term__caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: #A81E22;
  transform: translateY(0.15em);
  animation: demo-blink 1.05s step-end infinite;
}
.demo-term__prompt.is-sent .demo-term__caret { display: none; }
@keyframes demo-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Answer body */
.demo-term__answer > * {
  opacity: 1;
  transform: none;
}
.demo-term__answer > .is-in {
  animation: demo-rise 0.34s ease-out both;
}
@keyframes demo-rise {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.demo-term__say {
  margin: 0 0 0.75rem;
  color: #E4DACA;
}
.demo-term__say strong { color: #FBF8F1; font-weight: 600; }
.demo-term__say code,
.demo-term__head code {
  background: rgba(166, 129, 63, 0.16);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  color: #E8C88A;
}
.demo-term__head {
  margin: 1.15rem 0 0.6rem;
  color: #E8C88A;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.demo-term__head:first-child { margin-top: 0; }

/* A tool call — visually distinct from prose, because it is the product's whole point */
.demo-term__tool {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 0.55rem;
  padding: 0.4rem 0.65rem;
  background: rgba(166, 129, 63, 0.09);
  border-left: 2px solid #A6813F;
  border-radius: 0 4px 4px 0;
  font-size: 0.875rem;
}
.demo-term__tool::before {
  content: "\2192";
  color: #A6813F;
}
.demo-term__toolname { color: #F0DCB4; }
.demo-term__toolnote { color: #9C9082; font-size: 0.8125rem; }

/* Controls */
.demo-term__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(166, 129, 63, 0.18);
  flex-wrap: wrap;
}
.demo-term__btn {
  font: inherit;
  font-size: 0.8125rem;
  color: #EFE7D9;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(166, 129, 63, 0.3);
  border-radius: 5px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.demo-term__btn:hover { background: rgba(168, 30, 34, 0.22); border-color: #A81E22; }
.demo-term__btn--ghost { background: transparent; }
.demo-term__note {
  margin-left: auto;
  font-size: 0.75rem;
  color: #8A8075;
  letter-spacing: 0.03em;
}

/* Gallery tile that links to a demo */
.demo-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Match the screenshot tiles it sits beside (1274x733 captures) so the gallery row
     stays level and the captions line up. */
  aspect-ratio: 1274 / 733;
  padding: 0.9rem 1rem 0.85rem;
  overflow: hidden;
  background: var(--color-surface-dark, #1E1915);
  border: 1px solid rgba(166, 129, 63, 0.28);
  border-radius: 8px;
  color: #EFE7D9;
  text-decoration: none;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.demo-tile:hover {
  transform: translateY(-3px);
  border-color: #A81E22;
  box-shadow: 0 12px 28px rgba(27, 23, 18, 0.26);
}
.demo-tile__q { font-size: 0.8125rem; color: #FBF8F1; line-height: 1.5; }
.demo-tile__q::before { content: "\203A  "; color: #A81E22; font-weight: 700; }
.demo-tile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: #A6813F;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.demo-tile__go { color: #EFE7D9; }

@media (max-width: 640px) {
  .demo-term__screen { padding: 1rem; font-size: 0.875rem; min-height: 18rem; }
  .demo-term__note { display: none; }
}
