/* ---------------------------------------------------------------------------
   Shared by every page: the chat dock and the screenshot lightbox (site.js).
   Moved out of site.css so the home page, which has its own stylesheet
   (home.css), can carry both without the rest of the old design. Reads the
   tokens each page defines: site.css on the inner pages, home.css on the home.
   --------------------------------------------------------------------------- */

/* ── chat dock ───────────────────────────────────────────────────────────── */
.chat-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border: none; border-radius: var(--r-pill);
  background: var(--accent); color: #fff; font: inherit; font-size: .94rem; font-weight: 560;
  box-shadow: var(--shadow-lg); cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
@media (prefers-color-scheme: dark) { .chat-launch { color: #0b0e14; } }
.chat-launch:hover { background: var(--accent-hover); transform: translateY(-2px); }
.chat-launch:active { transform: translateY(0); }
.chat-launch[hidden] { display: none; }

.chat {
  position: fixed; right: 22px; bottom: 22px; z-index: 61;
  width: min(392px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 44px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.chat[hidden] { display: none; }
.chat__head { display: flex; align-items: center; gap: 11px; padding: 15px 16px;
              border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.chat__title { font-weight: 590; font-size: .97rem; }
.chat__sub { font-size: .79rem; color: var(--ink-3); }
.chat__close { margin-left: auto; background: transparent; border: none; cursor: pointer;
               color: var(--ink-3); padding: 5px; border-radius: var(--r-sm); font-size: 1.1rem;
               line-height: 1; }
.chat__close:hover { color: var(--ink); background: var(--bg); }
.chat__log { flex: 1; overflow-y: auto; padding: 18px 16px; display: grid; gap: 12px;
             align-content: start; }
.msg { max-width: 85%; padding: 11px 14px; border-radius: var(--r-lg); font-size: .93rem;
       line-height: 1.5; }
.msg--bot { background: var(--bg-sunken); border: 1px solid var(--line);
            border-bottom-left-radius: var(--r-sm); justify-self: start; }
.msg--me { background: var(--accent); color: #fff; border-bottom-right-radius: var(--r-sm);
           justify-self: end; }
@media (prefers-color-scheme: dark) { .msg--me { color: #0b0e14; } }
.msg--sys { justify-self: center; text-align: center; font-size: .82rem; color: var(--ink-3);
            background: transparent; padding: 2px; }
/* Quick replies. Stacked rather than inline because the labels are sentences,
   and a wrapped pill row reads as broken. */
.chat__choices { display: grid; gap: 7px; justify-items: start; }
a.chat__choice { text-decoration: none; display: block; }
a.chat__choice:hover { text-decoration: none; }
.chat__choice {
  font: inherit; font-size: .89rem; text-align: left; cursor: pointer;
  padding: 9px 14px; border-radius: var(--r-lg);
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  color: var(--accent); font-weight: 520;
  transition: background .16s var(--ease), transform .12s var(--ease);
}
.chat__choice:hover { background: color-mix(in srgb, var(--accent) 14%, var(--bg-raised)); }
.chat__choice:active { transform: translateY(1px); }

.chat__foot { border-top: 1px solid var(--line); padding: 13px 14px; background: var(--bg-raised); }
.chat__row { display: flex; gap: 9px; align-items: flex-end; }
.chat__row input, .chat__row textarea {
  flex: 1; padding: 10px 13px; font: inherit; font-size: .93rem;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: var(--r-pill); resize: none;
}
.chat__row input::placeholder { color: var(--ink-3); opacity: 1; }
.chat__row input:focus { outline: none; border-color: var(--accent);
                         box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.chat__send { border: none; background: var(--accent); color: #fff; cursor: pointer;
              width: 40px; height: 40px; border-radius: var(--r-pill); display: grid;
              place-items: center; flex: none; }
@media (prefers-color-scheme: dark) { .chat__send { color: #0b0e14; } }
.chat__send:hover { background: var(--accent-hover); }
.chat__send:disabled { opacity: .45; cursor: not-allowed; }
.chat__hint { font-size: .76rem; color: var(--ink-3); margin-top: 9px; }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ink-3);
            display: block; animation: blink 1.3s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: .6; } }

/* ── lightbox ────────────────────────────────────────────────────────────────
   The screenshots are 2880px wide and the page shows them at ~600. That is not
   blur, it is scale: a whole 1440px app squeezed into a column, so its own UI
   text falls below legibility. Rather than crop or fake a zoom, let people open
   the real thing at full size. */
.shot img { cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  /* Column flex, not absolute positioning: the caption used to be pinned to the
     bottom and the image simply grew over it on short viewports. Stacking them
     means the image gets whatever height is left after the caption, always. */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(8, 10, 14, .88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%; min-height: 0; flex: 0 1 auto;
  width: auto; height: auto;
  border-radius: var(--r-sm);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8);
  /* The point of opening it is to read the UI inside, so never upscale past 1:1
     and never let the browser smooth it on the way. */
  image-rendering: -webkit-optimize-contrast;
  cursor: zoom-out;
}
.lightbox__cap {
  flex: none; max-width: 70ch;
  text-align: center; color: #cfd4dd; font-size: .87rem; line-height: 1.45;
  pointer-events: none;
}
/* The caption is context, not the point. On a short viewport it gives way. */
@media (max-height: 520px) { .lightbox__cap { display: none; } }
.lightbox__close {
  position: absolute; top: max(12px, 2vh); right: max(12px, 2vw);
  width: 42px; height: 42px; border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1);
  color: #fff; font-size: 1.35rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .2); }

.lightbox img { animation: lb-in .22s var(--ease) both; }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lightbox img { animation: none; } }
