/* Hero chat demo: an assistant answering a local "who should I hire?" question.
   Greyscale tokens from styles.css only; colour appears once, on the "not mentioned" status dot. */

.hc { display: flex; flex-direction: column; gap: var(--space-cell-x); min-width: 0; margin: 0; }

.hc-window {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--sidebar); color: var(--sidebar-foreground);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--border);
}

/* Title bar */
.hc-bar {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 var(--space-panel);
  border-bottom: 1px solid var(--divider);
}
.hc-bar-mark {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-full);
  background: var(--card); color: var(--foreground);
}
.hc-bar-mark svg { width: 12px; height: 12px; }
.hc-bar-title { font: 600 0.78125rem/1 var(--font-sans); }
.hc-bar-meta {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font: 400 0.6875rem/1 var(--font-mono); color: var(--subtle-foreground);
}
.hc-bar-meta svg { width: 12px; height: 12px; }

/* Thread: fixed height so nothing on the page moves while the demo plays */
.hc-thread {
  position: relative; height: 420px; overflow: hidden; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 100%);
}
.hc-inner { display: flex; flex-direction: column; gap: 10px; min-height: 100%; padding: var(--space-panel); }

.hc-empty {
  margin: auto; text-align: center; font: 600 0.9375rem/1.2 var(--font-sans); color: var(--subtle-foreground);
  transition: opacity .25s;
}

/* User message */
.hc-user {
  align-self: flex-end; max-width: 85%; padding: var(--space-cell-y) var(--space-cell-x);
  background: var(--accent); color: var(--accent-foreground);
  border-radius: var(--radius-xl); border-bottom-right-radius: var(--radius-sm);
  font: 400 0.8125rem/1.25rem var(--font-sans); overflow-wrap: break-word;
  transform-origin: 100% 100%;
}

/* Search tool panel */
.hc-tool { align-self: stretch; background: var(--card); color: var(--card-foreground); border-radius: var(--radius-lg); }
.hc-tool-head { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 var(--space-cell-x); }
.hc-tool-title { font: 500 0.75rem/1rem var(--font-sans); color: var(--muted-foreground); }
.hc-tool-title b { font-weight: 500; color: var(--foreground); }
.hc-chev { width: 12px; height: 12px; margin-left: auto; color: var(--subtle-foreground); transition: transform .3s; }
.hc-tool.is-collapsed .hc-chev { transform: rotate(-90deg); }
.hc-tool-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s cubic-bezier(.3,.7,.2,1); }
.hc-tool.is-collapsed .hc-tool-body { grid-template-rows: 0fr; }
.hc-tool-clip { overflow: hidden; min-height: 0; }
.hc-tool-pad { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--space-cell-x) var(--space-cell-x); }

.hc-queries { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.hc-q {
  position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; height: 26px; padding: 0 10px;
  border-radius: var(--radius-full); background: var(--secondary); overflow: hidden;
  font: 400 0.71875rem/1 var(--font-mono); color: var(--muted-foreground);
}
.hc-q-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-q.is-done { color: var(--foreground); }
.hc-q:not(.is-done)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--card) 70%, transparent) 50%, transparent 80%);
  transform: translateX(-100%); animation: hc-shimmer 1.1s linear infinite;
}

/* Spinner and done tick share one 12px slot */
.hc-ic { position: relative; flex: none; width: 12px; height: 12px; }
.hc-ic::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--input); border-top-color: var(--foreground);
  animation: hc-spin .7s linear infinite;
}
.hc-ic svg { position: absolute; inset: 0; width: 12px; height: 12px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.5,1); }
.is-done > .hc-ic::before { opacity: 0; animation: none; }
.is-done > .hc-ic svg { opacity: 1; transform: none; }

.hc-sources { display: flex; flex-direction: column; gap: 6px; }
.hc-sources-label { display: flex; align-items: center; gap: 8px; font: 500 0.75rem/1rem var(--font-sans); color: var(--muted-foreground); }
.hc-count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--foreground); }
.hc-domains { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.hc-domains li {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1px var(--border); font: 400 0.6875rem/1 var(--font-mono); color: var(--muted-foreground);
}
.hc-domains li::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--subtle-foreground); }
.hc-domains li.hc-more::before { display: none; }

/* Answer */
.hc-answer { display: flex; flex-direction: column; gap: 8px; }
.hc-answer-text { font: 400 0.8125rem/1.25rem var(--font-sans); min-height: 1.25rem; }
.hc-tok { animation: hc-tok .28s ease-out both; }
.hc-stream::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%;
  background: var(--foreground); vertical-align: 1px; animation: hc-pulse .8s ease-in-out infinite;
}

.hc-cards { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hc-card {
  display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 10px var(--space-cell-x); background: var(--card); color: var(--card-foreground); border-radius: var(--radius-lg);
}
.hc-rank {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-full);
  background: var(--secondary); font: 600 0.6875rem/1 var(--font-mono);
}
.hc-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hc-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hc-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 0.8125rem/1.25rem var(--font-sans); }
.hc-rating { flex: none; display: inline-flex; align-items: center; gap: 5px; }
.hc-stars {
  --fill: 100%;
  position: relative; display: block; width: 55px; height: 10px; flex: none;
  background: linear-gradient(90deg, var(--foreground) var(--fill), var(--accent) var(--fill));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 10'%3E%3Cpath d='M5 .4l1.4 2.9 3.2.4-2.3 2.2.6 3.2L5 7.6 2.1 9.1l.6-3.2L.4 3.7l3.2-.4z'/%3E%3C/svg%3E") 0 0 / 11px 10px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 10'%3E%3Cpath d='M5 .4l1.4 2.9 3.2.4-2.3 2.2.6 3.2L5 7.6 2.1 9.1l.6-3.2L.4 3.7l3.2-.4z'/%3E%3C/svg%3E") 0 0 / 11px 10px repeat-x;
}
.hc-score { font: 500 0.6875rem/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.hc-card-sub { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 4px; min-width: 0; }
.hc-reason { min-width: 0; font: 400 0.75rem/1.125rem var(--font-sans); color: var(--muted-foreground); }
.hc-cite {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px;
  border-radius: var(--radius-full); background: var(--secondary); font: 400 0.65625rem/1 var(--font-mono); color: var(--muted-foreground);
}
.hc-cite svg { width: 10px; height: 10px; }

/* The beat that lands the point */
.hc-miss {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 var(--space-cell-x);
  border-radius: var(--radius-lg); overflow: hidden;
  background: color-mix(in srgb, var(--destructive) 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--destructive) 35%, transparent);
  font: 400 0.8125rem/1.25rem var(--font-sans);
}
.hc-miss b { font-weight: 600; }
.hc-miss .dot { position: relative; }
.hc-miss-tag { margin-left: auto; font: 400 0.6875rem/1 var(--font-mono); color: var(--subtle-foreground); white-space: nowrap; }

/* Composer */
.hc-composer { padding: 0 var(--space-cell-x) var(--space-cell-x); }
.hc-field {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 var(--space-panel);
  background: var(--muted); border-radius: var(--radius-3xl); box-shadow: inset 0 0 0 1px var(--input);
  transition: box-shadow .2s;
}
.hc-field.is-focus { box-shadow: inset 0 0 0 1px var(--input), 0 0 0 2px color-mix(in srgb, var(--ring) 35%, transparent); }
.hc-input { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; height: 20px; overflow: hidden; white-space: nowrap; font: 400 0.8125rem/1.25rem var(--font-sans); }
.hc-typed { display: flex; justify-content: flex-end; min-width: 0; overflow: hidden; white-space: pre; }
.hc-placeholder { position: absolute; left: 0; color: var(--subtle-foreground); pointer-events: none; }
.hc-caret { flex: none; width: 1.5px; height: 16px; margin-left: 1px; background: var(--foreground); animation: hc-blink 1.05s steps(1) infinite; }
.hc-field.is-typing .hc-caret { animation: none; }
.hc-field:not(.is-focus) .hc-caret { visibility: hidden; }
.hc-send {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0;
  border-radius: var(--radius-full); background: var(--secondary); color: var(--subtle-foreground);
  transition: background-color .15s, color .15s, transform .12s cubic-bezier(.3,.7,.4,1);
  pointer-events: none;
}
.hc-send svg { width: 15px; height: 15px; }
.hc-field.has-text .hc-send { color: var(--foreground); }
.hc-send.is-pressed { transform: scale(.86); background: var(--accent); }

/* Caption */
.hc-caption { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.hc-caption-line { font: 500 0.8125rem/1.25rem var(--font-sans); color: var(--muted-foreground); }
.hc-caption-line b { font-weight: 600; color: var(--foreground); }

/* ---------- Animation states (only when hero-chat.js is running) ---------- */
.hc-in { animation: hc-in .38s cubic-bezier(.2,.8,.2,1) both; }
.hc-pop { animation: hc-pop .34s cubic-bezier(.3,1.4,.5,1) both; }
.hc-card.hc-in .hc-stars { animation: hc-stars .7s .15s ease-out both; }
.hc-miss.hc-land { animation: hc-in .45s cubic-bezier(.2,.8,.2,1) both; }
.hc-miss.hc-land::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--destructive) 16%, transparent) 50%, transparent 70%);
  animation: hc-sweep 1.2s .25s ease-out both;
}
.hc-miss.hc-land .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--destructive); opacity: 0;
  animation: hc-ring 1.6s .4s ease-out 3;
}
.hc-inner.is-out { animation: hc-out .4s ease-in both; }
.hc.is-paused *, .hc.is-paused *::before, .hc.is-paused *::after { animation-play-state: paused !important; }

/* Before the script takes over, hide the static answer so it doesn't flash, with a timed fallback reveal. */
.hc.hc-armed .hc-static { visibility: hidden; animation: hc-reveal 0s 2.5s forwards; }

@keyframes hc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes hc-pop { 0% { opacity: 0; transform: translateY(10px) scale(.94); } 100% { opacity: 1; transform: none; } }
@keyframes hc-tok { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
@keyframes hc-spin { to { transform: rotate(360deg); } }
@keyframes hc-shimmer { to { transform: translateX(100%); } }
@keyframes hc-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@keyframes hc-pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@property --fill { syntax: '<percentage>'; inherits: false; initial-value: 100%; }
@keyframes hc-stars { from { --fill: 0%; } }
@keyframes hc-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes hc-ring { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes hc-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes hc-reveal { to { visibility: visible; } }

@media (max-width: 860px) {
  .hc { max-width: 560px; width: 100%; margin-inline: auto; }
}
@media (max-width: 480px) {
  .hc-thread { height: 460px; }
  .hc-inner { padding: var(--space-cell-x); }
  .hc-bar { padding: 0 var(--space-cell-x); }
  .hc-user { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .hc *, .hc *::before, .hc *::after { animation: none !important; transition: none !important; }
}
