/* The agent finder (/start): a calm full-screen conversation in the landing
   page's look — off-white ground, ink, one orange signal, mono labels. Built
   on welcome.css (tokens, buttons, form fields); only what is new is here. */

.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
body.af { min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }

/* ---- top bar ---- */
.af-top {
  position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.af-label, .af-step, .af-mini {
  font: 500 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute);
}
.af-label { padding-left: 18px; border-left: 1px solid var(--line-2); }
.af-step { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.af-motion, .af-exit {
  padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 4px; background: transparent;
  color: var(--ink-2); font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.af-motion:hover, .af-exit:hover { border-color: var(--ink); color: var(--ink); }

/* ---- the floating example agents ---- */
.af-float { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.af-card {
  position: absolute; width: 200px; padding: 12px 14px; border: 1px solid var(--line-2);
  border-radius: 8px; background: var(--paper); box-shadow: 0 18px 40px -26px rgba(17,17,17,.35);
  display: flex; flex-direction: column; gap: 4px; opacity: .92;
  animation: af-drift 22s ease-in-out infinite alternate;
}
.af-card .src { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.af-card b { font-size: 14px; letter-spacing: -0.01em; color: var(--ink); }
.af-card .st { font: 11px var(--mono); color: var(--ink-2); }
.af-card .st::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--signal); vertical-align: 1px; }
.af-card.c1 { left: 3vw; top: 13vh; transform: rotate(-3deg); }
.af-card.c2 { left: 7vw; top: 34vh; animation-duration: 26s; animation-delay: -6s; transform: rotate(2deg); }
.af-card.c3 { left: 3.5vw; top: 55vh; animation-duration: 19s; animation-delay: -11s; }
.af-card.c4 { right: 3vw; top: 12vh; animation-duration: 24s; animation-delay: -3s; transform: rotate(3deg); }
.af-card.c5 { right: 7vw; top: 33vh; animation-duration: 21s; animation-delay: -9s; transform: rotate(-2deg); }
.af-card.c6 { right: 3.5vw; top: 54vh; animation-duration: 27s; animation-delay: -14s; }
@keyframes af-drift {
  0%   { translate: 0 0; }
  50%  { translate: 10px -16px; }
  100% { translate: -8px 12px; }
}
/* Where the conversation needs the width, the cards give way. */
@media (max-width: 1180px) { .af-card.c2, .af-card.c5 { display: none; } }
@media (max-width: 1020px) { .af-float { display: none; } }
@media (max-height: 640px) { .af-card.c3, .af-card.c6 { display: none; } }

/* ---- the conversation ---- */
.af-main { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; padding: clamp(24px, 6vh, 72px) 16px 0; }
.af-stage { width: min(680px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.af-spark { width: 44px; height: 44px; color: var(--ink); margin-bottom: 22px; animation: af-turn 18s linear infinite; }
@keyframes af-turn { to { rotate: 360deg; } }
.af-log { list-style: none; margin: 0 0 18px; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.af-log:empty { display: none; }
.af-log li { display: flex; flex-direction: column; gap: 6px; }
.af-log .q { font: 11px/1.4 var(--mono); letter-spacing: .06em; color: var(--mute); }
.af-log .a {
  align-self: flex-end; max-width: 86%; padding: 9px 13px; border-radius: 12px 12px 3px 12px;
  background: var(--ink); color: var(--paper); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere;
}
.af-log .a.skipped { background: transparent; color: var(--mute); border: 1px dashed var(--line-2); font: 12px var(--mono); }
.af-log .r { font-size: 14px; color: var(--ink-2); max-width: 92%; }
.af-now { width: 100%; }
.af-hello { margin: 0 0 12px; font: 500 12px/1.6 var(--mono); letter-spacing: .08em; color: var(--ink-2); }
.af-hello.said { font: 15px/1.55 var(--sans); letter-spacing: 0; color: var(--ink-2); max-width: 60ch; margin-inline: auto; }
.af-q {
  margin: 0; font-size: clamp(26px, 4.2vw, 42px); line-height: 1.08; font-weight: 600;
  letter-spacing: -0.035em; text-wrap: balance; color: var(--ink);
}
.af-q:focus { outline: none; }
.af-q:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.af-typing { display: inline-flex; gap: 5px; margin: 18px 0 0; }
.af-typing[hidden] { display: none; }
.af-typing span:not(.vh) { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); animation: af-dot 1s ease-in-out infinite; }
.af-typing span:nth-child(2) { animation-delay: .15s; }
.af-typing span:nth-child(3) { animation-delay: .3s; background: var(--signal); }
@keyframes af-dot { 50% { transform: translateY(-5px); opacity: .5; } }
.af-noscript { margin-top: 20px; color: var(--ink-2); }

/* ---- the dock: chips, the box, the three actions ---- */
/* Above the consent sheet on a phone while it shows (--cc-lift), and the
   consent card above the dock on a wide screen (--cc-avoid). */
body.af { --cc-avoid: var(--af-dock-h, 0px); }
.af-dock {
  position: sticky; bottom: var(--cc-lift, 0px); z-index: 5; padding: 0 16px;
  pointer-events: none;   /* only the column below takes clicks; the edges stay the cards' */
}
.af-dock[hidden] { display: none; }
.af-dock-in {
  width: min(720px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 10px;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  pointer-events: auto; background: var(--ground); box-shadow: 0 -28px 24px 4px var(--ground);
}
.af-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.af-chips:empty { display: none; }
.af-chip, .af-ex, .af-act {
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); color: var(--ink);
  font: 13px/1.2 var(--sans); padding: 8px 13px; cursor: pointer; transition: background 120ms, border-color 120ms;
}
.af-chip:hover, .af-ex:hover, .af-act:hover { border-color: var(--ink); }
.af-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.af-chip[aria-pressed="true"]::before { content: "✓ "; }
.af-examples { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); }
.af-examples[hidden] { display: none; }
.af-ex-list { display: flex; flex-direction: column; gap: 6px; }
.af-ex { text-align: left; border-radius: 8px; background: var(--ground); }
.af-box {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px;
  border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper);
  box-shadow: 0 24px 60px -34px rgba(17,17,17,.45);
}
.af-box:focus-within { outline: 2px solid var(--signal); outline-offset: 2px; }
.af-box textarea {
  flex: 1; min-height: 40px; max-height: 160px; resize: none; border: 0; outline: 0; padding: 9px 0;
  background: transparent; color: var(--ink); font: 16px/1.45 var(--sans); overflow-y: hidden;
}
.af-box textarea::placeholder { color: var(--mute); }
.af-box.contact textarea { display: none; }
.af-contact { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 6px 0; }
.af-contact[hidden] { display: none; }
.af-contact .f input { background: var(--ground); }
.af-send {
  flex: none; width: 42px; height: 42px; border: 0; border-radius: 10px; background: var(--ink);
  color: var(--paper); cursor: pointer; display: grid; place-items: center;
}
.af-send svg { width: 20px; height: 20px; }
.af-send:hover { background: #2a2a2a; }
.af-send[disabled] { opacity: .5; cursor: progress; }
.af-send:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.af-err { margin: 0; font-size: 13px; color: #b3261e; text-align: center; }
.af-err:empty { display: none; }
.af-err .sel { font-family: var(--mono); }
.af-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.af-act { display: inline-flex; align-items: center; gap: 7px; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 9px 13px; background: transparent; }
.af-act svg { width: 13px; height: 13px; color: var(--signal-text); }
.af-act[aria-expanded="true"] { border-color: var(--ink); background: var(--paper); }
.af-act[disabled] { opacity: .45; cursor: default; }
.af-privacy { margin: 0; text-align: center; font-size: 12px; line-height: 1.45; color: var(--mute); }

/* ---- the blueprint ---- */
.bp {
  width: min(960px, 100%); margin: 8px auto 48px; padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--ink); border-radius: 12px; background: var(--paper);
  box-shadow: 0 40px 90px -50px rgba(17,17,17,.55); display: flex; flex-direction: column; gap: 22px;
}
.bp[hidden] { display: none; }
.bp:focus { outline: none; }
.bp-head h2 { margin: 8px 0 10px; font-size: clamp(26px, 3.6vw, 40px); line-height: 1; font-weight: 600; letter-spacing: -0.04em; text-transform: uppercase; }
.bp-summary { margin: 0; font-size: 16px; color: var(--ink-2); max-width: 70ch; }
.bp-source { margin: 8px 0 0; font: 11px var(--mono); letter-spacing: .06em; color: var(--mute); }
.bp-agents { display: flex; flex-direction: column; gap: 14px; }
.bp-agent { border: 1px solid var(--line-2); border-radius: 10px; padding: 18px; background: var(--ground); }
.bp-agent header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bp-agent h3 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.bp-agent .tag.dp { border-color: var(--signal-text); color: var(--signal-text); }
.bp-agent .who { margin: 4px 0 0; font: 11px var(--mono); color: var(--mute); letter-spacing: .04em; }
.bp-agent .does { margin: 10px 0 14px; color: var(--ink-2); }
.bp-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bp-cols h4, .bp-block h4 { margin: 0 0 8px; font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.bp-cols ul, .bp-block ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink); }
.bp-cols li, .bp-block li { padding-left: 14px; position: relative; }
.bp-cols li::before, .bp-block li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 1px; background: var(--ink); }
.bp-cols .bp-sys li::before { background: var(--signal); border-radius: 50%; }
.bp-cols .bp-sys small { display: block; color: var(--mute); font-size: 12px; }
.bp-guards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.bp-guards span { font: 11px var(--mono); padding: 4px 8px; border-radius: 3px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.bp-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bp-block { border: 1px solid var(--line-2); border-radius: 10px; padding: 16px 18px; }
.bp-block[hidden] { display: none; }
.bp-block p { margin: 0 0 8px; font-weight: 600; }
.bp-next { margin: 0; padding: 14px 18px; border-left: 3px solid var(--signal); background: var(--ground); font-size: 15px; }
.bp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bp-actions .btn, .bp-form .btn { cursor: pointer; }
.bp-copied { font: 11px var(--mono); color: var(--ok-text); letter-spacing: .06em; }
.bp-form { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.bp-form[hidden], .bp-done[hidden] { display: none; }
.bp-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bp-note { font-size: 12px; color: var(--mute); max-width: 52ch; }
.bp-form .btn[disabled] { opacity: .6; cursor: progress; }
.bp-done { padding: 18px; border-radius: 10px; background: var(--ground); }
/* Email me this blueprint (where the instance sends mail), else Download. */
.bp-actions .btn[hidden], .bp-email-done:empty { display: none; }
.bp-email-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.bp-email-row .f { flex: 1 1 260px; max-width: 420px; }
.bp-email .bp-note { margin: 0; }
.bp-email .bp-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bp-email-done { margin: 0; padding: 14px 18px; border-radius: 10px; background: var(--ground); font-size: 14.5px; }
.bp-done h3 { margin: 6px 0; font-size: 20px; text-transform: uppercase; letter-spacing: -0.02em; }
.bp-done p { margin: 0; color: var(--ink-2); }
body.af-finished .af-stage { display: none; }

/* ---- phones ---- */
@media (max-width: 640px) {
  .af-top { gap: 10px; }
  .af-label, .af-motion { display: none; }
  .af-main { padding-top: 20px; }
  .af-spark { width: 34px; height: 34px; margin-bottom: 14px; }
  .af-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .af-chip { flex: none; }
  .af-contact { grid-template-columns: 1fr; }
  .bp-cols, .bp-row { grid-template-columns: 1fr; }
  .bp-actions .btn { flex: 1 1 100%; justify-content: center; }
  .af-privacy { font-size: 11.5px; }
  .af-actions { flex-wrap: nowrap; gap: 6px; }
  .af-act { padding: 8px 9px; letter-spacing: .04em; font-size: 10px; gap: 5px; }
}

/* ---- motion: paused by the button, and never for reduced motion ---- */
.af-paused .af-card, .af-paused .af-spark { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .af-card, .af-spark, .af-typing span { animation: none !important; }
  .af-motion { display: none; }
}

/* ---- earlier answers, folded ---- */
.af-log li.more { align-items: center; }
.af-more {
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; padding: 4px 6px;
  font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 3px;
}
.af-more:hover { color: var(--ink); }
.bp { scroll-margin-top: 72px; }
body.af-finished .af-float { display: none; }

/* Drawn edge to edge (viewport-fit=cover): the notch, the rounded corners
   and the home bar keep their distance. */
body {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
