/* guest-talk.css - the SIGNED-OUT (guest) view of every *-talk.html page.
 *
 * 2026-11-14, Jason (desktop Chrome incognito + iPhone, henry.aiexec.me/?guest=1):
 *   1. the old starfield/streak canvas looked dated; he wants a modern, calm,
 *      premium background that is not flat;
 *   2. the header stacked a stray "AI" square, a serif title, a moon emoji, a
 *      second "AI" square and a clipped "SIGN IN" pill;
 *   3. the left rail showed the OWNER workspace (My office, Calendar, Tasks...)
 *      and a Search box, none of which do anything for a visitor.
 *
 * EVERYTHING HERE IS SCOPED TO html.ts-guest, which guest-talk.js sets only
 * when the page is opened with ?guest=1 or app-rail.js reports a signed-out
 * visitor (nav.app-rail.is-signed-out). A signed-in owner never gets the
 * class, so the owner rail, header and background are byte-for-byte what they
 * were. Owner desks (ai-desk.html) never load this file at all.
 *
 * The TALKING HEADS block in dedicated-talk.css (heads, ring, transcript,
 * composer geometry) is deliberately NOT restyled here: this file only makes
 * the panels behind it transparent so the aurora shows through.
 */

html.ts-guest {
  --tg-rail: 248px;
  --tg-bg: #050a17;
  --tg-a1: rgba(67, 56, 202, .42);   /* indigo */
  --tg-a2: rgba(30, 64, 175, .40);   /* deep blue */
  --tg-a3: rgba(14, 165, 233, .20);  /* cyan hint */
  --tg-a4: rgba(109, 40, 217, .22);  /* violet */
  --tg-veil: linear-gradient(180deg, rgba(5,10,23,.10) 0%, rgba(5,10,23,.35) 55%, rgba(5,10,23,.70) 100%);
  --tg-glass: rgba(10, 18, 38, .52);
  --tg-glass-strong: rgba(12, 21, 44, .88);
  --tg-line: rgba(148, 163, 230, .16);
  --tg-fg: #eef2ff;
  --tg-muted: #9fb0d4;
  --tg-hover: rgba(148, 163, 255, .10);
  --tg-active: rgba(129, 140, 248, .18);
  --tg-accent: #8ea2ff;
  --tg-cta-bg: #f5f7ff;
  --tg-cta-fg: #0a1022;
}
html.ts-guest.light-mode, html.ts-guest[data-theme="light"] {
  --tg-bg: #eef2fa;
  --tg-a1: rgba(99, 102, 241, .20);
  --tg-a2: rgba(59, 130, 246, .18);
  --tg-a3: rgba(34, 211, 238, .16);
  --tg-a4: rgba(167, 139, 250, .18);
  --tg-veil: linear-gradient(180deg, rgba(238,242,250,0) 0%, rgba(238,242,250,.25) 60%, rgba(238,242,250,.6) 100%);
  --tg-glass: rgba(255, 255, 255, .58);
  --tg-glass-strong: rgba(255, 255, 255, .94);
  --tg-line: rgba(30, 41, 90, .12);
  --tg-fg: #0f1a33;
  --tg-muted: #4a5878;
  --tg-hover: rgba(67, 56, 202, .07);
  --tg-active: rgba(67, 56, 202, .11);
  --tg-accent: #4338ca;
  --tg-cta-bg: #0f172a;
  --tg-cta-fg: #ffffff;
}

/* ---------- 1. Background: slow dark aurora, CSS only ---------------------- */
.tg-aurora { display: none; }
html.ts-guest .tg-aurora {
  display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden;
  pointer-events: none; background: var(--tg-bg);
}
html.ts-guest .tg-aurora i {
  position: absolute; display: block; border-radius: 50%;
  width: 80vmax; height: 80vmax; will-change: transform;
}
html.ts-guest .tg-aurora i:nth-child(1) { left: -25vmax; top: -35vmax; background: radial-gradient(closest-side, var(--tg-a1), transparent); animation: tg-drift-a 46s ease-in-out infinite alternate; }
html.ts-guest .tg-aurora i:nth-child(2) { right: -30vmax; top: -20vmax; background: radial-gradient(closest-side, var(--tg-a2), transparent); animation: tg-drift-b 58s ease-in-out infinite alternate; }
html.ts-guest .tg-aurora i:nth-child(3) { left: 10vmax; bottom: -45vmax; background: radial-gradient(closest-side, var(--tg-a3), transparent); animation: tg-drift-c 64s ease-in-out infinite alternate; }
html.ts-guest .tg-aurora i:nth-child(4) { right: -20vmax; bottom: -40vmax; width: 60vmax; height: 60vmax; background: radial-gradient(closest-side, var(--tg-a4), transparent); animation: tg-drift-a 72s ease-in-out infinite alternate-reverse; }
html.ts-guest .tg-aurora::after {
  content: ""; position: absolute; inset: 0; background: var(--tg-veil);
}
@keyframes tg-drift-a { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(12vmax, 8vmax, 0) scale(1.12); } }
@keyframes tg-drift-b { from { transform: translate3d(0,0,0) scale(1.05); } to { transform: translate3d(-14vmax, 10vmax, 0) scale(.94); } }
@keyframes tg-drift-c { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(10vmax, -12vmax, 0) scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
  html.ts-guest .tg-aurora i { animation: none !important; }
}

/* Retire the old moving canvas and let the aurora show through the panels. */
html.ts-guest #voice-viz-canvas { display: none !important; }
html.ts-guest body.ts-casmia-talk { background: var(--tg-bg) !important; --ts-rail: 0px !important; }
html.ts-guest body.ts-casmia-talk .ts-talk-host,
html.ts-guest body.ts-casmia-talk #ts-talk-layout { background: transparent !important; }
html.ts-guest body.ts-casmia-talk #ts-talk-layout .ts-composer {
  background: var(--tg-glass) !important; border-color: var(--tg-line) !important;
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
html.ts-guest body.ts-casmia-talk #ts-talk-layout .ts-composer:focus-within { border-color: var(--tg-accent) !important; }

/* ---------- 3. Old owner rail out, guest rail in --------------------------- */
html.ts-guest nav.app-rail,
html.ts-guest .app-rail-backdrop,
html.ts-guest .app-rail-bbar { display: none !important; }

.tg-rail, .tg-menu-btn, .tg-scrim { display: none; }
html.ts-guest .tg-rail {
  display: flex; flex-direction: column; gap: 4px;
  position: fixed; z-index: 9690; left: 0; top: var(--hdr-h, 56px); bottom: 0;
  width: var(--tg-rail); box-sizing: border-box;
  padding: 18px 12px calc(16px + env(safe-area-inset-bottom));
  background: var(--tg-glass);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-right: 1px solid var(--tg-line);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tg-fg); overflow-y: auto;
}
html.ts-guest .tg-card { display: flex; align-items: center; gap: 12px; padding: 6px 8px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--tg-line); }
html.ts-guest .tg-card img, html.ts-guest .tg-card .tg-initial {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  box-shadow: 0 0 0 2px var(--tg-line);
}
html.ts-guest .tg-card .tg-initial { display: grid; place-items: center; background: var(--tg-active); font-weight: 700; }
html.ts-guest .tg-card b { display: block; font-size: 15px; font-weight: 650; line-height: 1.25; }
html.ts-guest .tg-card small { display: block; font-size: 12px; line-height: 1.35; color: var(--tg-muted); margin-top: 2px; }
html.ts-guest .tg-card .tg-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--tg-muted); margin-top: 4px; }
html.ts-guest .tg-card .tg-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.18); }
html.ts-guest .tg-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tg-muted); padding: 10px 10px 4px; }
html.ts-guest .tg-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px;
  padding: 9px 10px; border: 0; border-radius: 10px; background: transparent;
  color: var(--tg-fg); font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.3; text-align: left;
  text-decoration: none; cursor: pointer; box-sizing: border-box;
  transition: background .15s ease;
}
html.ts-guest .tg-item:hover { background: var(--tg-hover); }
html.ts-guest .tg-item[aria-current="page"] { background: var(--tg-active); font-weight: 600; }
html.ts-guest .tg-item:focus-visible { outline: 2px solid var(--tg-accent); outline-offset: 2px; }
html.ts-guest .tg-item svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
html.ts-guest .tg-item .tg-ext { margin-left: auto; width: 14px; height: 14px; opacity: .5; }
html.ts-guest .tg-spacer { flex: 1 1 auto; min-height: 12px; }
html.ts-guest .tg-signin {
  justify-content: center; font-weight: 600; background: var(--tg-cta-bg); color: var(--tg-cta-fg);
}
html.ts-guest .tg-signin:hover { background: var(--tg-cta-bg); opacity: .9; }
html.ts-guest .tg-foot { font-size: 11.5px; color: var(--tg-muted); text-align: center; padding: 10px 6px 0; }

/* Desktop: rail is permanent; the talk column and the title sit right of it. */
@media (min-width: 1024px) {
  html.ts-guest body.ts-casmia-talk { --ts-rail: var(--tg-rail) !important; }
}
/* Phone / tablet: rail becomes a sheet behind a menu button in the header. */
@media (max-width: 1023.98px) {
  html.ts-guest .tg-rail {
    top: 0; z-index: 10002; width: min(300px, 86vw);
    padding-top: calc(18px + env(safe-area-inset-top));
    background: var(--tg-glass-strong);
    transform: translateX(-102%); transition: transform .22s ease; visibility: hidden;
    box-shadow: 0 0 48px rgba(0,0,0,.35);
  }
  html.ts-guest.tg-open .tg-rail { transform: none; visibility: visible; }
  html.ts-guest .tg-scrim { display: block; position: fixed; inset: 0; z-index: 10001; background: rgba(3,6,15,.5); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  html.ts-guest.tg-open .tg-scrim { opacity: 1; pointer-events: auto; }
  html.ts-guest .tg-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    position: fixed; z-index: 9705; top: calc((var(--hdr-h, 56px) - 38px) / 2); left: 10px;
    width: 38px; height: 38px; padding: 0; border-radius: 10px;
    border: 1px solid var(--tg-line); background: transparent; color: var(--tg-fg); cursor: pointer;
  }
  html.ts-guest .tg-menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
  html.ts-guest body #sip-top-bar .stb-slot.left { padding-left: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  html.ts-guest .tg-rail, html.ts-guest .tg-scrim { transition: none !important; }
}

/* ---------- 2. One clean header ------------------------------------------ */
html.ts-guest body #sip-top-bar {
  left: 0 !important; right: 0 !important; padding-left: 16px !important; padding-right: 16px !important;
  background: var(--tg-glass) !important; border-bottom: 1px solid var(--tg-line) !important;
  backdrop-filter: blur(20px) saturate(140%) !important; -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
}
/* Duplicate brand squares and the hidden "Read-only" badge. */
html.ts-guest .ts-brand-logo,
html.ts-guest .auth-badge,
html.ts-guest .signin-launcher { display: none !important; }
html.ts-guest .stb-aiexec-name { color: var(--tg-fg) !important; font-weight: 650 !important; letter-spacing: -.01em; }
html.ts-guest .stb-logo-link:hover { background: var(--tg-hover); }
/* The AI's name: centred over the talk column, same family as the rest. */
html.ts-guest body.ts-casmia-talk .henry-titlebar,
html.ts-guest body.ts-casmia-talk .ai-titlebar {
  left: var(--ts-rail, 0px) !important; right: 0 !important; height: var(--hdr-h, 56px) !important;
  top: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  pointer-events: none !important; padding: 0 140px !important; box-sizing: border-box !important;
}
html.ts-guest body.ts-casmia-talk .henry-titlebar .ht-name,
html.ts-guest body.ts-casmia-talk .ai-titlebar .ai-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 17px !important; font-weight: 650 !important; letter-spacing: -.01em !important;
  color: var(--tg-fg) !important; -webkit-text-fill-color: var(--tg-fg) !important;
  text-shadow: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
html.ts-guest body.ts-casmia-talk .henry-titlebar > :not(.ht-name),
html.ts-guest body.ts-casmia-talk .ai-titlebar > :not(.ai-name) { display: none !important; }
/* Theme toggle: a quiet outline icon instead of an emoji. */
html.ts-guest #stb-theme-btn {
  width: 36px !important; height: 36px !important; border-radius: 10px !important;
  font-size: 0 !important; color: var(--tg-fg) !important;
  background: transparent !important; border: 1px solid var(--tg-line) !important;
}
html.ts-guest #stb-theme-btn:hover { background: var(--tg-hover) !important; }
html.ts-guest #stb-theme-btn::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--tg-sun) center / contain no-repeat; mask: var(--tg-sun) center / contain no-repeat;
}
html.ts-guest.light-mode #stb-theme-btn::before, html.ts-guest[data-theme="light"] #stb-theme-btn::before {
  -webkit-mask-image: var(--tg-moon); mask-image: var(--tg-moon);
}
html.ts-guest {
  --tg-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
  --tg-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E");
}
/* One crisp Sign in button. The served pages carry up to three different
   sign-in controls (top-bar's #stb-signin-btn, the page's own floating
   #henry-signin-btn PIN pill, and on Henry a PIN-bound copy of the first);
   guests see exactly one, #tg-signin-btn, which offers Google and - where
   the page has one - its PIN door. */
html.ts-guest #stb-signin-btn,
html.ts-guest #henry-signin-btn { display: none !important; }
#tg-signin-btn, .tg-pop { display: none; }
html.ts-guest #tg-signin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--tg-cta-bg); color: var(--tg-cta-fg);
  font: 600 14px/1 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 1px 2px rgba(0,0,0,.18); white-space: nowrap; flex: 0 0 auto;
}
html.ts-guest #tg-signin-btn:hover { opacity: .9; }
html.ts-guest #tg-signin-btn:focus-visible, html.ts-guest #stb-theme-btn:focus-visible { outline: 2px solid var(--tg-accent) !important; outline-offset: 2px; }
html.ts-guest .tg-pop[data-open="1"] {
  display: block; position: fixed; z-index: 10003; top: calc(var(--hdr-h, 56px) + 6px); right: 12px;
  width: 280px; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 16px;
  border-radius: 14px; border: 1px solid var(--tg-line); background: var(--tg-glass-strong);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 48px rgba(0,0,0,.35); color: var(--tg-fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
html.ts-guest .tg-pop b { display: block; font-size: 15px; font-weight: 650; }
html.ts-guest .tg-pop p { margin: 4px 0 12px; font-size: 13px; line-height: 1.45; color: var(--tg-muted); }
html.ts-guest .tg-pop a, html.ts-guest .tg-pop button {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; box-sizing: border-box;
  min-height: 42px; padding: 0 12px; margin-top: 8px; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none;
}
html.ts-guest .tg-pop .tg-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
html.ts-guest .tg-pop .tg-pin { background: transparent; color: var(--tg-fg); border: 1px solid var(--tg-line); }
html.ts-guest .tg-pop .tg-pin:hover { background: var(--tg-hover); }
html.ts-guest #sip-top-bar .stb-slot.right { gap: 8px !important; }

@media (max-width: 640px) {
  html.ts-guest body #sip-top-bar { padding-left: 10px !important; padding-right: 10px !important; }
  html.ts-guest body.ts-casmia-talk .henry-titlebar,
  html.ts-guest body.ts-casmia-talk .ai-titlebar { padding: 0 128px !important; }
  html.ts-guest #tg-signin-btn { padding: 0 13px; }
  html.ts-guest #stb-theme-btn { width: 36px !important; }
}
@media (max-width: 360px) {
  html.ts-guest #stb-theme-btn { display: none !important; }
  html.ts-guest body.ts-casmia-talk .henry-titlebar,
  html.ts-guest body.ts-casmia-talk .ai-titlebar { padding: 0 96px !important; }
}
