/* ==========================================================================
   Byte: cursor companion (design: companion-states.html)
   Positions inside .rc-bot are relative to Byte's head centre.
   ========================================================================== */
html.has-robot, html.has-robot * { cursor: none !important; }

.rc { --cyan: #5ab4ff; --sky: #3fa9f5; --violet: #0148c6; --pink: #ff5fa2; --dir: 1; --thrust: 1;
  --spring: cubic-bezier(.2, 1.4, .4, 1);
  position: fixed; inset: 0; z-index: 2147483647; pointer-events: none; user-select: none; -webkit-user-select: none;
  opacity: 0; transition: opacity .3s ease; }
.rc.is-visible { opacity: 1; }
.rc.is-flip { --dir: -1; }

/* ---------- arrow + things pinned to it ---------- */
.rc-pointer, .rc-at { position: fixed; left: 0; top: 0; will-change: transform; }
.rc-pointer svg { display: block; margin: -1.5px 0 0 -2px; transform-origin: 2px 1.5px; transition: transform .2s var(--spring);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45)); }
.rc.is-down .rc-pointer svg { transform: scale(.85); }

.rc-pill { position: absolute; left: 16px; top: 22px; white-space: nowrap; padding: 9px 20px; border-radius: 999px;
  font: 700 13px/1 "Inter Tight", ui-sans-serif, system-ui, sans-serif; color: #fff;
  background: linear-gradient(135deg, #0148c6, #0155d4 55%, #3fa9f5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 8px 24px -6px rgba(1, 85, 212, .9);
  opacity: 0; scale: .5; transform-origin: 0 0; transition: opacity .2s, scale .45s var(--spring); }
.rc.is-button .rc-pill { opacity: 1; scale: 1; animation: btnGlow 1.6s ease-in-out infinite; }
.rc.is-flip .rc-pill { left: auto; right: 4px; transform-origin: 100% 0; } /* Byte is on the right: put the pill on the left */
.rc-ripple { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(130, 190, 255, .9); opacity: 0; }
.rc.is-button .rc-ripple { animation: ripple 1.6s ease-out infinite; }

.rc-target { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; opacity: 0; transform: scale(1.6); transition: opacity .25s, transform .45s var(--spring); }
.rc-target::before, .rc-target::after { content: ""; position: absolute; inset: 0; border: 2px solid rgba(90, 180, 255, .9); border-radius: 6px;
  clip-path: polygon(0 0, 30% 0, 30% 8%, 8% 8%, 8% 30%, 0 30%, 0 100%, 30% 100%, 30% 92%, 8% 92%, 8% 70%, 0 70%, 0 0, 100% 0, 100% 30%, 92% 30%, 92% 8%, 70% 8%, 70% 0, 100% 0, 100% 100%, 70% 100%, 70% 92%, 92% 92%, 92% 70%, 100% 70%, 100% 0); }
.rc-target::after { inset: -6px; opacity: .35; animation: pulse 1.3s infinite; }
.rc.is-scan .rc-target { opacity: 1; transform: none; }

/* ---------- Byte ---------- */
.rc-bot { position: fixed; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.rc-scale { position: absolute; left: 0; top: 0; width: 0; height: 0; scale: var(--size, 1); transform-origin: 0 0; } /* Byte + effects; size set from JS */
.rc-warp { position: absolute; left: -40px; top: -41px; width: 80px; height: 101px; transform-origin: 40px 41px; }
.rc-lean, .rc-flip { width: 100%; height: 100%; transform-origin: 40px 41px; }
.rc-flip { transform: scaleX(var(--dir)); transition: transform .45s var(--spring); }
.rc-flip svg { display: block; overflow: visible; transition: filter .3s;
  filter: drop-shadow(0 0 .8px rgba(8, 10, 22, .55)) drop-shadow(0 6px 14px rgba(1, 85, 212, .35)); }
.rc.is-button .rc-flip svg, .rc.is-code .rc-flip svg { filter: drop-shadow(0 0 .8px rgba(8, 10, 22, .55)) drop-shadow(0 0 12px rgba(90, 180, 255, .6)); }

/* animations from the design */
.rc .float { animation: float 3.4s ease-in-out infinite; transform-box: fill-box; }
.rc .shadow { animation: shadow 3.4s ease-in-out infinite; transform-origin: 60px 148px; }
.rc .rb-thrust { transform-origin: 60px 122px; transform: scaleY(var(--thrust)); transition: transform .15s; }
.rc .flame { animation: flicker .12s ease-in-out infinite alternate; transform-origin: 60px 124px; }
.rc .ear-l { animation: earL 5s ease-in-out infinite; transform-origin: 40px 40px; }
.rc .ear-r { animation: earR 5s ease-in-out infinite; transform-origin: 80px 40px; }
.rc .blink { animation: blink 4.2s infinite; transform-box: fill-box; transform-origin: center; }
.rc .glow { filter: drop-shadow(0 0 3px rgba(90, 180, 255, .9)); }
.rc .ear-in { fill: url(#rbEar); }
.rc[data-ears="alert"] .ear-in { fill: url(#rbEarAlert); }
.rc[data-ears="love"] .ear-in { fill: url(#rbEarLove); }
.rc.is-moving .float { animation-duration: 1.2s; }
.rc.is-alert .float { animation: shake .5s ease-in-out infinite; }
.rc .rb-arm { transform-origin: 80px 98px; transition: transform .45s var(--spring); }
.rc.is-button .rb-arm, .rc.is-code .rb-arm { transform: rotate(-58deg); }
.rc.is-love .rb-arm { animation: wave .3s ease-in-out 4 alternate; }

/* eyes cross-fade */
.rc .eye { opacity: 0; transition: opacity .18s; }
.rc[data-eyes="open"] .eye--open, .rc[data-eyes="happy"] .eye--happy, .rc[data-eyes="look"] .eye--look,
.rc[data-eyes="scan"] .eye--scan, .rc[data-eyes="love"] .eye--love, .rc[data-eyes="think"] .eye--think,
.rc[data-eyes="wink"] .eye--wink, .rc[data-eyes="worried"] .eye--worried { opacity: 1; }

/* glow behind Byte (love / alert) */
.rc-aura { position: absolute; left: -80px; top: -70px; width: 160px; height: 150px; border-radius: 50%; opacity: 0; transition: opacity .4s; }
.rc.is-love .rc-aura { opacity: 1; background: radial-gradient(closest-side, rgba(255, 95, 162, .22), transparent 70%); }
.rc.is-alert .rc-aura { opacity: 1; background: radial-gradient(closest-side, rgba(244, 63, 94, .26), transparent 70%); animation: pulse 1s infinite; }
.rc.is-love .rc-warp { animation: hop .6s var(--spring); }

/* ---------- moving: streaks ---------- */
.rc-trail { position: absolute; left: 0; top: 30px; width: 0; height: 0; }
.rc-trail i { position: absolute; right: 0; top: 0; height: 3px; border-radius: 3px; width: var(--len, 0px);
  background: linear-gradient(90deg, transparent, rgba(90, 180, 255, .9)); opacity: 0; transition: opacity .35s, width .12s linear; }
.rc-trail i:nth-child(2) { top: -14px; right: 6px; height: 2px; width: calc(var(--len, 0px) * .7); background: linear-gradient(90deg, transparent, rgba(63, 125, 255, .9)); }
.rc-trail i:nth-child(3) { top: 12px; right: 10px; height: 2px; width: calc(var(--len, 0px) * .6); }
.rc.is-moving .rc-trail i { opacity: 1; }
.rc.is-moving .rc-trail i:nth-child(2) { opacity: .6; } .rc.is-moving .rc-trail i:nth-child(3) { opacity: .5; }

/* ---------- hoverButton: rays ---------- */
.rc-rays { position: absolute; left: -18px; top: -60px; width: 36px; height: 20px; }
.rc-rays i { position: absolute; bottom: 0; width: 2.5px; height: 9px; border-radius: 2px; background: #bfe1ff; box-shadow: 0 0 6px #bfe1ff; transform-origin: bottom center; opacity: 0; transition: opacity .2s; }
.rc-rays i:nth-child(1) { left: 6px; rotate: -35deg; } .rc-rays i:nth-child(2) { left: 17px; height: 11px; } .rc-rays i:nth-child(3) { left: 28px; rotate: 35deg; }
.rc.is-button .rc-rays i { animation: rayPop 1.6s ease-in-out infinite; }

/* ---------- scanning: beam ---------- */
.rc-beam { position: fixed; left: 0; top: 0; height: 80px; margin-top: -40px; transform-origin: 0 50%; opacity: 0; transition: opacity .3s;
  background: linear-gradient(90deg, rgba(63, 169, 245, .55), rgba(63, 169, 245, .05) 85%);
  clip-path: polygon(0 45%, 100% 0, 100% 100%, 0 55%); }
.rc-beam::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 6px); }
.rc.is-scan .rc-beam { opacity: 1; }

/* ---------- hoverCode: panel ---------- */
.rc-code { position: absolute; top: -34px; left: calc(var(--dir) * 82px - 36px); width: 72px; height: 64px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(63, 169, 245, .22), rgba(1, 85, 212, .16)); border: 1px solid rgba(90, 180, 255, .5);
  box-shadow: 0 0 24px -4px rgba(63, 169, 245, .6), inset 0 1px 0 rgba(255, 255, 255, .12); backdrop-filter: blur(6px);
  opacity: 0; transform: perspective(300px) rotateY(calc(var(--dir) * -14deg)) translateY(10px) scale(.5); transition: opacity .25s, transform .5s var(--spring); }
.rc-code .dots { position: absolute; top: 7px; left: 9px; display: flex; gap: 3px; }
.rc-code .dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.rc-code .dots i:first-child { background: #fb7185; }
.rc-code b { font: 700 20px/1 ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace; color: #9fd0ff; text-shadow: 0 0 10px rgba(90, 180, 255, .8); margin-top: 6px; }
.rc-code .caret { display: inline-block; width: 2px; height: 15px; background: #9fd0ff; margin-left: 2px; vertical-align: middle; animation: caret 1s steps(1) infinite; }
.rc.is-code .rc-code { opacity: 1; transform: perspective(300px) rotateY(calc(var(--dir) * -14deg)) translateY(0) scale(1); }

/* ---------- thinking: orbit + dots ---------- */
.rc-orbit { position: absolute; left: -61px; top: -28px; width: 122px; height: 78px; opacity: 0; transform: scale(.5); transition: opacity .4s, transform .6s var(--spring); }
.rc-orbit svg { width: 100%; height: 100%; overflow: visible; }
.rc-orbit .ring-dash { animation: dash 3s linear infinite; }
.rc.is-think .rc-orbit { opacity: 1; transform: none; }
.rc-thought { position: absolute; top: -66px; left: calc(var(--dir) * 52px - 24px); display: flex; gap: 5px; padding: 8px 12px; border-radius: 999px;
  background: rgba(1, 85, 212, .18); border: 1px solid rgba(63, 125, 255, .45); backdrop-filter: blur(4px);
  opacity: 0; transform: translateY(8px) scale(.5); transition: opacity .3s, transform .5s var(--spring); }
.rc-thought i { width: 6px; height: 6px; border-radius: 50%; background: #7db8ff; animation: typing 1.2s ease-in-out infinite; }
.rc-thought i:nth-child(2) { animation-delay: .15s; } .rc-thought i:nth-child(3) { animation-delay: .3s; }
.rc-thought::after { content: ""; position: absolute; left: calc(50% - 22px * var(--dir) - 4px); bottom: -9px; width: 8px; height: 8px; border-radius: 50%; background: rgba(1, 85, 212, .25); border: 1px solid rgba(63, 125, 255, .45); }
.rc.is-think .rc-thought { opacity: 1; transform: none; }

/* ---------- alert: "!" ---------- */
.rc-bang { position: absolute; top: -62px; left: calc(var(--dir) * 50px - 8px); opacity: 0; transform: translateY(10px) scale(.3); transform-origin: 50% 100%; transition: opacity .2s, transform .45s var(--spring); }
.rc-bang svg { display: block; filter: drop-shadow(0 0 10px rgba(244, 63, 94, .85)); }
.rc.is-alert .rc-bang { opacity: 1; transform: none; animation: bangBounce .9s cubic-bezier(.3, 1.6, .5, 1) .45s infinite alternate; }

/* ---------- loveMode: hearts ---------- */
.rc-hearts { position: absolute; left: 0; top: -34px; }
.rc-hearts i { position: absolute; left: 0; top: 0; opacity: 0; animation: heartUp 1.5s ease-in forwards; }
.rc-hearts svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(255, 95, 162, .8)); }

/* ---------- textTip: typing bubble ---------- */
.rc-bubble { position: absolute; bottom: calc(48px * var(--size, 1)); left: calc(16px * var(--size, 1)); padding: 9px 13px; border-radius: 14px 14px 14px 4px; white-space: nowrap;
  background: linear-gradient(180deg, rgba(27, 34, 56, .96), rgba(8, 10, 22, .96)); border: 1px solid rgba(63, 125, 255, .5);
  box-shadow: 0 10px 30px -10px rgba(1, 85, 212, .7); color: #e6e9ff;
  font: 600 12.5px/1.35 "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  transform-origin: 0 100%; opacity: 0; transform: translateY(8px) scale(.6); transition: opacity .2s, transform .5s var(--spring); }
.rc.tip-left .rc-bubble { left: auto; right: calc(16px * var(--size, 1)); border-radius: 14px 14px 4px 14px; transform-origin: 100% 100%; }
.rc.has-tip .rc-bubble { opacity: 1; transform: none; }
.rc-bubble .typed { display: block; clip-path: inset(0 100% 0 0); } /* revealed by the typeIn animation set from JS */
.rc-bubble .typed::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: #9fd0ff; animation: caret .8s steps(1) infinite; }
.rc-bubble small { display: block; color: #8fa3c8; font-weight: 500; font-size: 11.5px; margin-top: 2px; }
.rc-bubble small:empty { display: none; }

/* ---------- teleport ---------- */
.rc-portalfx { position: fixed; left: 0; top: 0; width: 0; height: 0; }
.rc-portalfx i { position: absolute; left: -31px; top: -55px; scale: calc(.2 + var(--size, 1) * .8); animation: portalOpen 1.1s ease-in-out forwards; }
.rc-portalfx svg { display: block; overflow: visible; }
.rc-portalfx .spin1 { animation: spin 3s linear infinite; transform-origin: 28px 50px; }
.rc-portalfx .spin2 { animation: spin 2s linear infinite reverse; transform-origin: 28px 50px; }
.rc-warpl { position: absolute; left: 0; top: 0; }
.rc-warpl i { position: absolute; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(63, 125, 255, .9)); opacity: 0; }
.rc-warpl i:nth-child(1) { left: -30px; top: 10px; width: 60px; } .rc-warpl i:nth-child(2) { left: -26px; top: 24px; width: 46px; } .rc-warpl i:nth-child(3) { left: -34px; top: -4px; width: 40px; }
.rc.is-tp-out .rc-warpl i { animation: warp .45s ease-in infinite; }
.rc.is-tp-out .rc-warpl i:nth-child(2) { animation-delay: .15s; } .rc.is-tp-out .rc-warpl i:nth-child(3) { animation-delay: .3s; }
.rc.is-tp-out .rc-warp { animation: suckIn .45s cubic-bezier(.55, 0, .9, .4) forwards; }
.rc.is-tp-hidden .rc-warp { opacity: 0; }
.rc.is-tp-in .rc-warp { animation: popOut .6s var(--spring) both; }
.rc.is-tp .rc-pill, .rc.is-tp .rc-ripple, .rc.is-tp .rc-target, .rc.is-tp .rc-rays, .rc.is-tp .rc-code, .rc.is-tp .rc-beam,
.rc.is-tp .rc-bubble, .rc.is-tp .rc-bang, .rc.is-tp .rc-trail, .rc.is-tp .rc-orbit, .rc.is-tp .rc-thought { opacity: 0 !important; transition-duration: .1s; }

/* ---------- keyframes (from the design + cursor-specific) ---------- */
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
@keyframes shadow { 0%, 100% { transform: scale(1); opacity: .9 } 50% { transform: scale(.75); opacity: .5 } }
@keyframes flicker { from { transform: scaleY(.85) } to { transform: scaleY(1.15) } }
@keyframes earL { 0%, 88%, 100% { transform: rotate(0) } 92% { transform: rotate(-10deg) } 96% { transform: rotate(4deg) } }
@keyframes earR { 0%, 70%, 100% { transform: rotate(0) } 74% { transform: rotate(10deg) } 78% { transform: rotate(-4deg) } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1) } 95% { transform: scaleY(.1) } }
@keyframes btnGlow { 0%, 100% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 8px 24px -6px rgba(1, 85, 212, .9) } 50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .35) inset, 0 8px 34px -2px rgba(1, 85, 212, 1) } }
@keyframes ripple { 0%, 45% { transform: scale(.2); opacity: 0 } 50% { opacity: 1 } 100% { transform: scale(2.4); opacity: 0 } }
@keyframes rayPop { 0%, 40%, 100% { opacity: .2; height: 6px } 55% { opacity: 1; height: 11px } }
@keyframes caret { 50% { opacity: 0 } }
@keyframes heartUp { 0% { transform: translateY(10px) scale(.4); opacity: 0 } 20% { opacity: 1; transform: translate(calc(var(--hx) * .3), 0) scale(1) } 100% { transform: translate(var(--hx), -56px) scale(.8) rotate(12deg); opacity: 0 } }
@keyframes dash { to { stroke-dashoffset: -60 } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45 } 30% { transform: translateY(-4px); opacity: 1 } }
@keyframes typeIn { to { clip-path: inset(0 0 0 0); } }
@keyframes shake { 0%, 100% { transform: translateX(0) } 20% { transform: translateX(-3px) rotate(-3deg) } 40% { transform: translateX(3px) rotate(3deg) } 60% { transform: translateX(-2px) } 80% { transform: translateX(2px) } }
@keyframes bangBounce { from { transform: translateY(0) scale(1) } to { transform: translateY(-8px) scale(1.08) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes warp { 0% { transform: translateX(-30px) scaleX(.3); opacity: 0 } 50% { opacity: 1 } 100% { transform: translateX(20px) scaleX(1); opacity: 0 } }
@keyframes pulse { 50% { opacity: .4 } }
@keyframes hop { 0% { transform: none } 35% { transform: translateY(-14px) scale(1.06, .96) } 65% { transform: translateY(0) scale(.96, 1.04) } 100% { transform: none } }
@keyframes wave { from { transform: rotate(0) } to { transform: rotate(-50deg) } }
@keyframes suckIn { 0% { transform: none; opacity: 1; filter: none } 100% { transform: translateX(calc(var(--dir) * 30px)) scale(.05) rotate(-540deg); opacity: 0; filter: blur(1px) hue-rotate(40deg) } }
@keyframes popOut { 0% { transform: scale(.05) rotate(360deg); opacity: 0 } 100% { transform: none; opacity: 1 } }
@keyframes portalOpen { 0% { opacity: 0; transform: scale(.15, .05) } 20%, 72% { opacity: 1; transform: scale(1) } 100% { opacity: 0; transform: scale(.2, .05) } }
