/* TAL-1 — the assistant on the landing.
   Ported from the Claude Design project, restyled for a white page.

   NO BOX (owner, 2026-08-08). The source had the robot sitting in a dark
   rounded card with a border and a shadow. Here the character is the only
   thing on screen: the canvas is transparent, the panel appears BESIDE it, and
   the only surfaces with edges are the chat panel and the button — because
   those are UI. The robot itself never sits inside anything. */

.tal1 {
  position: fixed; z-index: 45;
  inset-inline-end: clamp(12px, 2.4vw, 28px);
  bottom: clamp(10px, 2vw, 20px);
  display: flex; flex-direction: column; align-items: flex-end;
  /* nothing here paints — the dock is a positioning frame only */
  pointer-events: none;
}
.tal1 > * { pointer-events: auto; }

/* ===== the character ===== */
.tal1-pod {
  position: relative; width: 250px; height: 272px; cursor: pointer;
  /* the legs fade out instead of ending on a hard canvas edge, so the robot
     reads as standing in the page rather than cropped by a frame */
  -webkit-mask-image: linear-gradient(to bottom, #000 74%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 74%, transparent 99%);
  touch-action: manipulation;
  transform: translateY(26px); opacity: 0;
  transition: opacity .8s var(--ease), transform .9s cubic-bezier(.16, 1, .3, 1);
}
.tal1.is-in .tal1-pod { transform: none; opacity: 1; }
.tal1-pod canvas { display: block; width: 100%; height: 100%; position: relative; z-index: 1; }
/* the light it stands in — replaces the card that used to hold it */
.tal1-pod::before {
  content: ''; position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  width: 196px; height: 42px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(31, 98, 255, .20), transparent 70%);
  filter: blur(9px);
}

/* ===== greeting bubble ===== */
.tal1-say {
  /* pinned to the head, so these move whenever .tal1-pod is resized */
  position: absolute; inset-inline-end: calc(100% - 58px); bottom: 198px;
  width: 226px; max-width: calc(100vw - 56px); z-index: 2;
  background: #fff; border: 1px solid var(--line); border-radius: 15px;
  border-end-end-radius: 4px;
  padding: 11px 14px; font-size: 13.4px; line-height: 1.5; color: var(--ink);
  box-shadow: 0 20px 44px -22px rgba(12, 44, 130, .5);
  opacity: 0; transform: translateY(8px) scale(.96); transform-origin: bottom right;
  transition: .4s cubic-bezier(.2, .9, .3, 1.3); pointer-events: none;
}
.tal1-say.show { opacity: 1; transform: none; }
.tal1-say b { color: var(--blue); font-weight: 700; }
/* transform-origin has no logical form, so the corner it grows from has to be flipped by
   hand — otherwise the Arabic bubble scales in away from the robot it belongs to. */
[dir="rtl"] .tal1-say { transform-origin: bottom left; }

/* ===== call to action ===== */
.tal1-open {
  margin-top: -6px; cursor: pointer; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: #fff;
  padding: 11px 20px; border-radius: 100px;
  background: linear-gradient(180deg, #4B8CFF 0%, #1250E6 62%, #0A3AC8 100%);
  box-shadow: 0 12px 26px -10px rgba(15, 75, 230, .55), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
}
.tal1-open:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(15,75,230,.62), inset 0 1px 0 rgba(255,255,255,.45); }
.tal1.is-chat .tal1-open, .tal1.is-min .tal1-open { display: none; }

/* stow / restore */
.tal1-stow {
  position: absolute; top: 4px; inset-inline-end: 2px; z-index: 3;
  width: 24px; height: 24px; border-radius: 8px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); color: #8296B4;
  font-size: 15px; line-height: 1; display: none; align-items: center; justify-content: center;
}
.tal1-pod:hover .tal1-stow, .tal1-stow:focus-visible { display: flex; }
.tal1-stow:hover { color: var(--blue); border-color: rgba(31,98,255,.4); }
.tal1.is-chat .tal1-stow { display: none !important; }
.tal1.is-min .tal1-pod, .tal1.is-min .tal1-say { display: none; }
.tal1-tab {
  display: none; cursor: pointer; align-items: center; gap: 8px;
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--blue);
  padding: 10px 16px; border-radius: 100px;
  background: #fff; border: 1px solid rgba(31,98,255,.3);
  box-shadow: 0 12px 28px -14px rgba(12,44,130,.45);
}
.tal1.is-min .tal1-tab { display: inline-flex; }

/* ===== chat panel =====
   In chat the robot shrinks and tucks against the panel's top corner — it stays
   present and reacting, but the conversation is the subject. */
.tal1.is-chat .tal1-pod { width: 150px; height: 162px; margin-bottom: -18px; margin-inline-end: 16px; }
.tal1.is-chat .tal1-pod::before { width: 118px; height: 26px; bottom: 26px; }

.tal1-panel {
  width: min(440px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 34px 76px -32px rgba(12, 44, 130, .5), 0 6px 18px -10px rgba(12,44,130,.18);
  overflow: hidden; display: none; flex-direction: column;
  max-height: min(600px, calc(100vh - 250px));
}
.tal1.is-chat .tal1-panel { display: flex; }
.tal1-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px 11px; border-bottom: 1px solid var(--line);
}
.tal1-head .nm { font-size: 14.4px; font-weight: 700; flex: 1; }
.tal1-head .nm span {
  display: block; margin-top: 2px; font-weight: 500;
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; color: var(--blue);
}
.tal1-x {
  width: 28px; height: 28px; border-radius: 9px; cursor: pointer; flex: none;
  background: #F3F6FC; border: 1px solid var(--line); color: #8296B4;
  font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.tal1-x:hover { color: var(--blue); border-color: rgba(31,98,255,.4); }

.tal1-thread {
  flex: 1 1 auto; min-height: 230px; overflow-y: auto;
  padding: 14px 15px; display: flex; flex-direction: column; gap: 9px;
}
.tal1-msg {
  max-width: 88%; padding: 10px 13px; border-radius: 15px;
  font-size: 14.4px; line-height: 1.6; white-space: pre-wrap;
  animation: tal1Pop .3s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes tal1Pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tal1-msg.bot { align-self: flex-start; background: #F3F6FC; border-start-start-radius: 5px; color: #26364F; }
.tal1-msg.me {
  align-self: flex-end; border-start-end-radius: 5px; color: #fff; font-weight: 500;
  background: linear-gradient(135deg, #4B8CFF, #1250E6);
}
.tal1-dots {
  align-self: flex-start; display: flex; gap: 5px; padding: 12px 14px;
  border-radius: 15px; background: #F3F6FC; border-start-start-radius: 5px;
}
.tal1-dots i { width: 6px; height: 6px; border-radius: 50%; background: #93A3BE; animation: tal1Td 1.2s infinite; }
.tal1-dots i:nth-child(2) { animation-delay: .18s; }
.tal1-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes tal1Td { 0%,60%,100% { opacity:.3; transform: none; } 30% { opacity:1; transform: translateY(-4px); } }

.tal1-sugg { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 15px 11px; }
.tal1-sugg button {
  cursor: pointer; font-family: inherit; font-size: 12.2px; color: #46587A;
  padding: 7px 12px; border-radius: 100px;
  background: #fff; border: 1px solid var(--line);
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.tal1-sugg button:hover { border-color: rgba(31,98,255,.45); color: var(--blue); }

.tal1-form { display: flex; gap: 9px; padding: 11px 13px; border-top: 1px solid var(--line); }
.tal1-form input {
  flex: 1; min-width: 0; font-family: inherit; font-size: 14.2px; color: var(--ink);
  background: #F7F9FD; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.tal1-form input::placeholder { color: #A9B7CE; }
.tal1-form input:focus {
  outline: none; background: #fff; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31,98,255,.16);
}
.tal1-form button {
  width: 42px; flex: none; border-radius: 12px; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #4B8CFF, #1250E6); font-size: 15px;
}
.tal1-form button:disabled { opacity: .45; cursor: default; }

/* the answer carries a quiet provenance line — this is the real agent, and a
   visitor deserves to know a machine wrote it */
.tal1-foot {
  padding: 0 15px 11px; font-size: 11.4px; line-height: 1.5; color: #8296B4;
}
.tal1-foot a { color: var(--blue); font-weight: 600; }

@media (max-width: 640px) {
  .tal1-pod { width: 168px; height: 182px; }
  .tal1-say { display: none; }
  .tal1-panel { max-height: min(460px, calc(100vh - 170px)); }
}
@media (max-height: 620px) {
  .tal1-pod { width: 150px; height: 162px; }
  .tal1-say { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tal1-pod { transition: none; transform: none; opacity: 1; }
  .tal1-open { transition: none; }
  .tal1-open:hover { transform: none; }
}

/* "Clear" — storing what somebody typed without offering to erase it is not something to
   ship on a site that also has a privacy policy. Hidden until there is a thread to clear. */
.tal1-clear {
  flex: none; cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 600; color: #8296B4;
  padding: 5px 10px; border-radius: 8px;
  background: transparent; border: 1px solid var(--line);
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.tal1-clear:hover { color: var(--blue); border-color: rgba(31,98,255,.4); }
.tal1-clear[hidden] { display: none; }
