/* The Vitru bubble (components/VitruBubble.astro). B/683 (founder 25.11.2026, "שיחליף את בועת הAI בזה. ושיתאים את העיצוב של חלון השיחה לשפה הזאת"):
   the bubble is the Vitruvian gyro icon (a canvas drawn by vitru-gyro.js) and the chat panel moves from the smoke glass + aurora to the CODE FACTORY MAP HUD language
   of the reference page Design/vitruvian-gyro/vitruvian-gyro.html (DESIGN-SYSTEM 10.1, ch.14 row 35): a near-black field with a faint grid, cool ink, thin lines, glow.
   Colours come only from tokens.css (--vit-hud-*). The state on the root (data-vg-state: idle / listen / think / speak) sets the accent; purple appears only in the think state.
   Rules kept from the glass bubble: scoped under .vitru-bubble, keyframes prefixed vb-, z-index under the cart scrim/drawer/menu (28/27 < 30), only transform / opacity animate,
   the panel is opaque (AA on any page). Hebrew in Heebo; the VITRU wordmark is Latin in Archivo 800 (self-hosted, font-src 'self'). */
@font-face { font-family: "Archivo"; font-weight: 800; font-style: normal; font-display: swap; src: url("/assets/fonts/Archivo-latin-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
.vitru-bubble{
  --vg-c:var(--vit-hud-idle);
  --ease:cubic-bezier(.2,.75,.25,1);
  font-family:var(--vit-f-heb,Heebo,sans-serif);font-size:16px;line-height:1.5;font-weight:400;
}
.vitru-bubble[data-vg-state="listen"]{--vg-c:var(--vit-hud-listen)}
.vitru-bubble[data-vg-state="think"]{--vg-c:var(--vit-hud-think)}
.vitru-bubble[data-vg-state="speak"]{--vg-c:var(--vit-hud-speak)}
.vitru-bubble[hidden]{display:none}
.vitru-bubble :where(button,input){font:inherit;color:inherit;margin:0;box-sizing:border-box}
.vitru-bubble :where(button){appearance:none;-webkit-appearance:none;border:0;padding:0;background:none;text-align:inherit}
.vitru-bubble *,.vitru-bubble *::before,.vitru-bubble *::after{box-sizing:border-box}

/* ---- the bubble: the gyro straight on the paper (addendum 2, founder 26.11 "שלא יהיה רקע שחור מאחורה": no disc, no shadow; the canvas draws surface "light") ---- */
.vitru-bubble .vb{position:fixed;left:24px;bottom:24px;width:152px;height:152px;z-index:28;display:block;touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none;
  border-radius:50%;background:transparent;
  transition:transform .2s var(--ease)}
.vitru-bubble .vb:hover{transform:scale(1.05)}
.vitru-bubble .vb:active{cursor:grabbing;transform:scale(.97)}
.vitru-bubble .vg{display:block;width:100%;height:100%;pointer-events:none}
@media (max-width:767.98px){.vitru-bubble .vb{left:16px;bottom:16px;width:160px;height:160px}}   /* founder 03.12 "תכפיל פי שניים": 76→152 desktop, 80→160 phone. Was addendum 3 (founder 26.11, "תגדיל את כל האייקון לפלאפון בפי 1.25"): 64 x 1.25 = 80 on a phone; 64px stays the floor */
/* ch.9: on mobile (under 768) the shared shell keeps a bottom padding of the bubble height + 16px (160 + 16 = 176), so the last line of a page is never under the bubble */
@media (max-width:767.98px){body:has(.vitru-bubble:not([hidden])) .sheet{padding-block-end:176px}}

/* ---- the panel: CODE FACTORY MAP HUD ---- */
.vitru-bubble .vp{position:fixed;z-index:27;transform-origin:var(--ox,0) var(--oy,100%);width:min(400px,calc(100vw - 32px));border-radius:14px;color:var(--vit-hud-ink);
  background:
    radial-gradient(420px 200px at 50% -40px,color-mix(in srgb,var(--vg-c) 9%,transparent),transparent 70%),
    linear-gradient(var(--vit-hud-grid) 1px,transparent 1px) 0 0/24px 24px,
    linear-gradient(90deg,var(--vit-hud-grid) 1px,transparent 1px) 0 0/24px 24px,
    var(--vit-hud-bg);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--vg-c) 32%,var(--vit-hud-line-2)),0 0 26px color-mix(in srgb,var(--vg-c) 16%,transparent),0 24px 60px rgb(4 6 10 / 42%);
  opacity:0;transform:scale(.2);pointer-events:none;visibility:hidden;
  transition:opacity .22s var(--ease),transform .38s cubic-bezier(.2,.9,.25,1.05),visibility 0s .38s}
.vitru-bubble .vp.open{opacity:1;transform:none;pointer-events:auto;visibility:visible;transition-delay:0s}
.vitru-bubble .vp .in{position:relative;padding:14px 16px 12px}
.vitru-bubble .vp .top{display:flex;align-items:center;gap:10px;margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid var(--vit-hud-line)}
.vitru-bubble .vg-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--vg-c);box-shadow:0 0 10px var(--vg-c)}
.vitru-bubble .vp .vb-title{margin:0;font:inherit;display:flex;align-items:center;gap:8px}
.vitru-bubble .vt{font-family:Archivo,Heebo,sans-serif;font-weight:800;letter-spacing:.24em}
.vitru-bubble .engraved{display:flex;align-items:center;color:var(--vit-hud-ink)}
.vitru-bubble .engraved .vt{font-size:15px;line-height:1}
.vitru-bubble .vb-beta{font-size:11px;font-weight:400;line-height:1.5;padding:0 7px;border:1px solid var(--vit-hud-line-2);border-radius:999px;color:var(--vit-hud-ink-2)}   /* founder 23.11: VITRU is still a beta */
.vitru-bubble .vp .top small#vb-status{display:block;font-size:12px;font-weight:300;color:var(--vit-hud-ink-2)}
.vitru-bubble .vp .x{margin-inline-start:auto;width:32px;height:32px;border-radius:8px;display:grid;place-items:center;cursor:pointer;color:var(--vit-hud-ink-2);border:1px solid var(--vit-hud-line)}
.vitru-bubble .vp .x:hover{color:var(--vit-hud-ink);border-color:var(--vit-hud-line-2)}
.vitru-bubble .msgs{display:flex;flex-direction:column;gap:8px;max-height:min(290px,calc(100vh - 400px));min-height:90px;overflow:auto;margin-bottom:12px;padding:2px;scrollbar-width:thin;scrollbar-color:var(--vit-hud-line-2) transparent}
.vitru-bubble .m{padding:8px 12px;border-radius:10px;font-size:15px;font-weight:300;max-width:88%;animation:vb-up .24s var(--ease) both;color:var(--vit-hud-ink)}
.vitru-bubble .m.a{align-self:flex-start;background:var(--vit-hud-bg-2);box-shadow:inset 0 0 0 1px var(--vit-hud-line);border-inline-start:2px solid color-mix(in srgb,var(--vit-hud-ink-2) 60%,transparent)}
.vitru-bubble .m.u{align-self:flex-end;background:color-mix(in srgb,var(--vit-hud-ink) 9%,var(--vit-hud-bg))}   /* a fill, no frame: a framed pill reads as a chip (design gate 25.11) */
.vitru-bubble .m.pending{color:var(--vit-hud-ink-2);animation:vb-up .24s var(--ease) both,vb-pulse 1.2s ease-in-out .24s infinite}
.vitru-bubble[data-vg-state="think"] .m.pending{color:var(--vit-hud-think);border-inline-start-color:var(--vit-hud-think)}
.vitru-bubble[data-vg-state="speak"] .m.a:last-child{border-inline-start-color:var(--vit-hud-speak)}
@keyframes vb-up{from{opacity:0;transform:translateY(6px)}}
@keyframes vb-pulse{50%{opacity:.55}}
.vitru-bubble .m.a a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.vitru-bubble .m .srcs{display:block;margin-top:6px;font-size:12.5px;color:var(--vit-hud-ink-2)}
.vitru-bubble .inp{display:flex;gap:6px;align-items:center;border-radius:10px;padding:4px;background:var(--vit-hud-bg-2);box-shadow:inset 0 0 0 1px var(--vit-hud-line-2)}
.vitru-bubble .inp:focus-within{box-shadow:inset 0 0 0 1px var(--vit-hud-listen),0 0 14px color-mix(in srgb,var(--vit-hud-listen) 22%,transparent)}
.vitru-bubble .inp input{flex:1;min-width:0;border:0;background:transparent;padding:8px 10px;font-size:15px;font-weight:300;color:var(--vit-hud-ink);outline:0}
.vitru-bubble .inp input::placeholder{color:var(--vit-hud-ink-2);opacity:1}
.vitru-bubble .inp .send{background:var(--vit-hud-ink);color:var(--vit-hud-bg);font-weight:500;border:0;border-radius:8px;padding:7px 14px;cursor:pointer}
.vitru-bubble .inp .send:disabled{cursor:default;opacity:.7}
.vitru-bubble .legal{font-size:11.5px;font-weight:300;color:var(--vit-hud-ink-2);margin:8px 0 0}
.vitru-bubble .legal a{color:inherit;text-decoration:underline;text-underline-offset:3px}

/* focus: a cyan ring on the dark field, an ink ring around the bubble (it sits on the paper page) */
.vitru-bubble .vb:focus-visible{outline:2px solid var(--vit-ink,currentColor);outline-offset:3px}

.vitru-bubble.vb-paused *{animation-play-state:paused!important}
@media (prefers-reduced-motion:reduce){.vitru-bubble *,.vitru-bubble *::before,.vitru-bubble *::after{animation:none!important;transition:none!important}}
/* the panel is opaque already; a browser without backdrop-filter gets the same opaque field (the rule stays so the fallback is explicit) */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .vitru-bubble .vp{background:var(--vit-hud-bg)}
}
.vitru-bubble[data-vb-away] .vb { display: none; }   /* a page form field has focus: the bubble steps aside (design gate 22.11) */

/* a page marks a block that must stay uncovered (a confirm step) with data-vb-avoid: while it is shown the bubble and its panel step aside (design gate 22.11) */
body:has([data-vb-avoid]:not([hidden])) .vitru-bubble .vb, body:has([data-vb-avoid]:not([hidden])) .vitru-bubble .vp { display: none; }
/* B/703 item 5: the pending line's screen-reader text («עונה…» / "Answering…"), read by the live region, not drawn */
.vitru-bubble .vb-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* "Ask the team" (flag PUBLIC_VITRU_ASK, off by default): the offer, the one-step confirm and the result line; same HUD tokens, opaque */
.vitru-bubble .vb-ask{align-self:stretch;margin:0;padding:2px 0;font-size:14px;font-weight:300;color:var(--vit-hud-ink)}
.vitru-bubble .vb-ask-go{display:inline-block;cursor:pointer;font-weight:500;color:var(--vit-clay,#D97757);text-decoration:underline;text-underline-offset:3px;min-height:24px}
@media (max-width:767.98px){.vitru-bubble .vb-ask-go{padding-block:10px;min-height:44px;box-sizing:border-box}}
.vitru-bubble .vb-ask-go:focus-visible,.vitru-bubble .vb-ask-opt:focus-visible,.vitru-bubble .vb-ask a:focus-visible{outline:2px solid var(--vit-hud-listen);outline-offset:2px}
.vitru-bubble .vb-ask a{color:var(--vit-clay,#D97757);text-underline-offset:3px}
.vitru-bubble .vb-ask-consent{line-height:1.5;margin-bottom:6px}
.vitru-bubble .vb-ask-opt{display:flex;gap:10px;align-items:center;min-height:44px;padding-inline:10px;border-inline-start:2px solid transparent;cursor:pointer;line-height:1.4}
.vitru-bubble .vb-ask-main{border-inline-start-color:var(--vit-clay,#D97757);font-weight:500}
.vitru-bubble .vb-ask-n{flex:none;min-width:1ch;color:var(--vit-hud-ink)}
