/* Lightbox + agent drawer for the cinematic pages (see extras.js). */

/* ---------- one scene per scroll ---------- */
/* Desktop steps scene to scene in extras.js; touch keeps a soft snap. */
html { scroll-snap-type: y proximity; }
html.step-scroll { scroll-snap-type: none; }
.scene, .chapter, .open, .end { scroll-snap-align: start; }
html.lb-lock { overflow: hidden; scroll-snap-type: none; }

/* ---------- media are clickable ---------- */
.view, .film, .tallview, .panview { cursor: zoom-in; }
.view:focus-visible, .film:focus-visible { outline: 2px solid var(--tint, #6d8bff); outline-offset: 4px; }
.lb { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 64px 24px 56px;
  background: rgba(5,5,8,.94); backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.lb.on { opacity: 1; pointer-events: auto; }
.lb-stage { display: grid; place-items: center; max-width: 100%; max-height: 100%; }
.lb-stage img, .lb-stage video { display: block; max-width: min(94vw, 1800px); max-height: calc(100vh - 140px); object-fit: contain; border-radius: 12px; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
/* Tall full-page captures scroll inside the lightbox at a readable width. */
.lb-stage.tall { width: min(94vw, 1100px); max-height: calc(100vh - 140px); overflow: auto; border-radius: 12px; place-items: start center; }
.lb-stage.tall img { max-width: 100%; max-height: none; width: 100%; border-radius: 0; }
.lb-close { position: fixed; top: 16px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(20,20,24,.8); color: #fff; font-size: 16px; cursor: pointer; }
.lb-close:hover { border-color: #fff; }
.lb-cap { position: fixed; bottom: 16px; left: 24px; right: 24px; margin: 0; text-align: center; font: 12px "IBM Plex Mono", monospace; letter-spacing: .06em; color: #8a8982; }

/* ---------- agent ---------- */
.agent { position: fixed; right: 20px; bottom: 20px; z-index: 120; font: 14.5px/1.55 "IBM Plex Sans", system-ui, sans-serif; color: #f3f1eb; }
.agent-launch { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.2); background: rgba(16,16,20,.82); backdrop-filter: blur(12px); color: #f3f1eb;
  font: 500 12px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 12px 40px -10px rgba(0,0,0,.7); transition: border-color .25s, transform .25s; }
.agent-launch:hover { border-color: #f3f1eb; transform: translateY(-1px); }
.agent-launch i, .agent-panel header i { width: 8px; height: 8px; border-radius: 50%; background: #3fbf8f; box-shadow: 0 0 0 4px rgba(63,191,143,.2); animation: ag-pulse 1.8s infinite; }
@keyframes ag-pulse { 50% { opacity: .4; } }
.agent-panel { position: fixed; right: 20px; bottom: 20px; width: min(400px, calc(100vw - 40px)); height: min(600px, calc(100vh - 110px));
  display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: rgba(14,14,18,.96); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 40px 120px -20px rgba(0,0,0,.8);
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none; transition: opacity .3s, transform .3s; }
.agent.open .agent-panel { opacity: 1; transform: none; pointer-events: auto; }
.agent.open .agent-launch { opacity: 0; pointer-events: none; }
.agent-panel header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.agent-panel header b { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.agent-panel header span { font: 11px "IBM Plex Mono", monospace; color: #8a8982; letter-spacing: .04em; }
.agent-x { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); background: none; color: #f3f1eb; cursor: pointer; }
.agent-log { flex: 1; overflow-y: auto; padding: 16px 18px; display: grid; align-content: start; gap: 12px; }
.agent-log:empty::before { content: "Ask about any project: what it was, what Sayena did, how she thinks. Answers come from her case studies."; color: #8a8982; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; }
.msg p { margin: 0; } .msg p + p { margin-top: 8px; }
.msg a { color: #f3f1eb; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); }
.msg.me { justify-self: end; background: #f3f1eb; color: #0b0b0d; }
.msg.bot { justify-self: start; background: rgba(255,255,255,.06); color: #d6d4cd; }
.dots { display: inline-flex; gap: 4px; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: #8a8982; animation: ag-pulse 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
.agent-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.agent-chips button { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); background: none; color: #d6d4cd; font: 13px "IBM Plex Sans", sans-serif; cursor: pointer; text-align: left; }
.agent-chips button:hover { border-color: #f3f1eb; color: #f3f1eb; }
.agent-panel form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.agent-panel input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: #f3f1eb; font: inherit; }
.agent-panel input:focus { outline: none; border-color: #f3f1eb; }
.agent-panel form button { width: 44px; border-radius: 12px; border: 0; background: #f3f1eb; color: #0b0b0d; font-size: 18px; cursor: pointer; }
/* Clear of the bottom name bar on narrower screens. */
@media (max-width: 1199px) { .agent { bottom: 76px; } }
@media (max-width: 600px) { .agent-launch { padding: 10px 14px; } }
@media (prefers-reduced-motion: reduce) { .agent-launch i, .agent-panel header i, .dots i { animation: none; } }
/* Close button pinned to the corner so the header never wraps. */
.agent-panel header { position: relative; padding-right: 60px; }
.agent-x { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); margin: 0; }

/* Request flow: inline actions and the confirmation card. */
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg-actions button { padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: none; color: #f3f1eb; font: 13px "IBM Plex Sans", sans-serif; cursor: pointer; }
.msg-actions button:hover { border-color: #f3f1eb; }
.msg-actions button.primary { background: #f3f1eb; color: #0b0b0d; border-color: #f3f1eb; }
.msg-card { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
/* The lock's request button. */
.ask-access { padding: 0; border: 0; background: none; color: var(--ink, #f3f1eb); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.4); }
.ask-access:hover { text-decoration-color: currentColor; }
.lock .ask-access { padding: 0; border-radius: 0; background: none; color: var(--ink); font-weight: 400; }
.agent-chips[hidden] { display: none; }
