/* Portfolio agent: floating orb with cursor-following eyes + chat panel. */
.agent-root { --agent-orange: #d0431f; --agent-gutter: var(--gutter, 30px); position: fixed; z-index: 120; right: var(--agent-gutter); bottom: var(--agent-gutter); font-family: "Funnel Sans", Arial, sans-serif; }

/* Orb */
.agent-orb { position: relative; display: block; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: linear-gradient(135deg, #93b4e9 0%, #a0b9e1 16%, #c3c3cd 32%, #e9c2a1 48%, #f9b375 64%, #f07a4f 82%, #d0431f 100%);
  box-shadow: 0 6px 18px rgba(240,122,79,.3), inset 0 -4px 8px rgba(0,0,0,.12), inset 0 2px 6px rgba(255,255,255,.3);
  transition: transform 300ms cubic-bezier(.22,1,.36,1), opacity 250ms ease, box-shadow 300ms ease; }
.agent-orb:hover { transform: scale(1.07); box-shadow: 0 14px 38px rgba(240,122,79,.45), inset 0 -6px 14px rgba(0,0,0,.18), inset 0 2px 6px rgba(255,255,255,.25); }
.agent-orb:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.agent-eyes { position: absolute; top: 50%; left: 50%; display: flex; gap: 7px; transform: translate(calc(-50% + var(--ex, 0px)), calc(-50% + var(--ey, 0px))); transition: transform 140ms ease-out; }
.agent-eye { display: block; width: 4px; height: 11px; border-radius: 4px; background: #fff6ef; box-shadow: 0 0 8px rgba(255,240,230,.9); transform-origin: center; transition: transform 90ms ease; }
.agent-orb.is-blinking .agent-eye { transform: scaleY(.12); }
.agent-orb-label { position: absolute; top: 50%; right: calc(100% + 12px); padding: 8px 12px; color: #000; background: #fff; border-radius: 4px; font-size: 14px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(6px, -50%); transition: opacity 200ms ease, transform 250ms ease; }
.agent-orb:hover .agent-orb-label, .agent-orb:focus-visible .agent-orb-label { opacity: 1; transform: translate(0, -50%); }
.agent-root.is-open .agent-orb { opacity: 0; transform: scale(.6); pointer-events: none; }
.agent-root.is-tucked .agent-orb { opacity: 0; transform: scale(.6) translateY(20px); pointer-events: none; }

/* Panel: full-height drawer docked to the right edge of the viewport. */
.agent-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; visibility: hidden; transition: opacity 300ms ease, visibility 0s linear 300ms; }
.agent-root.is-open .agent-backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }
.agent-panel { position: fixed; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(520px, 100vw); height: 100vh; height: 100dvh; overflow: hidden; color: #fff; background: #0e0e0e; border-left: 1px solid rgba(255,255,255,.12); box-shadow: -30px 0 80px rgba(0,0,0,.5);
  visibility: hidden; transform: translateX(100%); transition: transform 500ms cubic-bezier(.22,1,.36,1), visibility 0s linear 500ms; }
.agent-root.is-open .agent-panel { visibility: visible; transform: none; transition-delay: 0s; }
.agent-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--agent-gutter); border-bottom: 1px solid rgba(255,255,255,.1); }
.agent-head h2 { margin: 0; color: #fff; font-size: 18px; font-weight: 400; letter-spacing: -.3px; }
.agent-head-actions { display: flex; gap: 8px; }
.agent-icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: #fff; background: rgba(255,255,255,.07); border: 0; border-radius: 6px; cursor: pointer; transition: background 200ms ease; }
.agent-icon-btn:hover { background: rgba(255,255,255,.14); }
.agent-icon-btn:focus-visible, .agent-suggestion:focus-visible, .agent-send:focus-visible { outline: 2px solid var(--agent-orange); outline-offset: 2px; }
.agent-icon-btn svg { width: 18px; height: 18px; }

.agent-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 24px; overflow-y: auto; padding: 40px var(--agent-gutter) 32px; scrollbar-width: thin; }
.agent-empty { margin: 0; }
.agent-empty h3 { margin: 0; color: #fff; font-size: 30px; font-weight: 400; letter-spacing: -1px; line-height: 1.15; }
.agent-empty p { margin: 12px 0 0; color: rgba(255,255,255,.6); font-size: 17px; line-height: 1.45; }
.agent-suggestions { display: grid; gap: 2px; margin: 28px 0 0; padding: 0; list-style: none; }
.agent-suggestion { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; color: rgba(255,255,255,.8); background: none; border: 0; font: inherit; font-size: 16px; text-align: left; cursor: pointer; transition: color 200ms ease; }
.agent-suggestion:hover { color: #fff; }
.agent-suggestion svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--agent-orange); }

.agent-row { display: flex; align-items: flex-start; gap: 14px; }
.agent-row--user { justify-content: flex-end; }
.agent-row .agent-mini-orb { margin-top: 1px; }
.agent-avatar--user { display: flex; align-items: center; justify-content: center; gap: 4px; flex: 0 0 auto; width: 30px; height: 30px; margin-top: 7px; border-radius: 50%; background: #fff; }
.agent-avatar--user i { width: 3px; height: 8px; border-radius: 3px; background: #0e0e0e; }
.agent-msg { min-width: 0; font-size: 17px; line-height: 1.55; }
.agent-msg p { margin: 0; }
.agent-msg p + p { margin-top: 12px; }
.agent-msg a { color: var(--agent-orange); text-decoration: underline; text-underline-offset: 3px; }
.agent-msg--user { max-width: 80%; padding: 12px 18px; color: #fff; background: rgba(255,255,255,.1); border-radius: 12px; }
.agent-msg--bot { flex: 1 1 auto; padding-top: 3px; color: rgba(255,255,255,.88); }
.agent-suggestions--follow { margin: 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.agent-suggestions--follow .agent-suggestion { font-size: 15px; color: rgba(255,255,255,.6); }
.agent-thinking { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.55); font-size: 15px; }
.agent-thinking span { background: linear-gradient(90deg, rgba(255,255,255,.35) 0%, #fff 50%, rgba(255,255,255,.35) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: agent-shimmer 1.4s linear infinite; }
.agent-thinking i { width: 8px; height: 8px; border-radius: 50%; background: var(--agent-orange); animation: agent-pulse 1s ease-in-out infinite; }
@keyframes agent-shimmer { to { background-position: -200% 0; } }
@keyframes agent-pulse { 50% { transform: scale(.5); opacity: .5; } }

.agent-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 16px var(--agent-gutter) max(16px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.1); }
.agent-mini-orb { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #93b4e9 0%, #a0b9e1 16%, #c3c3cd 32%, #e9c2a1 48%, #f9b375 64%, #f07a4f 82%, #d0431f 100%); }
.agent-mini-orb i { width: 3px; height: 8px; border-radius: 3px; background: #fff6ef; }
.agent-input { flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 14px; color: #fff; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14); border-radius: 6px; font: inherit; font-size: 16px; outline: 0; transition: border-color 200ms ease; }
.agent-input::placeholder { color: rgba(255,255,255,.4); }
.agent-input:focus { border-color: var(--agent-orange); }
.agent-send { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; padding: 0; color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 6px; cursor: not-allowed; transition: background 200ms ease; }
.agent-send:not(:disabled) { background: var(--agent-orange); cursor: pointer; }
.agent-send:not(:disabled):hover { background: #c93d1e; }
.agent-send svg { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .agent-orb { width: 58px; height: 58px; }
  .agent-eyes { gap: 10px; }
  .agent-eye { width: 5px; height: 15px; }
  .agent-orb-label { display: none; }
  .agent-panel { width: 100vw; border-left: 0; }
  .agent-head, .agent-body, .agent-foot { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .agent-eyes, .agent-panel, .agent-orb, .agent-backdrop { transition: none; }
  .agent-thinking span, .agent-thinking i { animation: none; }
}

/* Eyes can never leave the orb; Abrar-style soft hover. */
.agent-eyes { transition: none; }
.agent-orb:hover { transform: scale(1.06); }

/* "Ask about me" tooltip: compact, all caps, 14px, -2% tracking. */
.agent-orb-label { padding: 6px 10px; font-size: 14px; font-weight: 300; line-height: 1; text-transform: uppercase; border-radius: 4px; }
html body .agent-orb-label { letter-spacing: -0.02em !important; }

/* Hover label: 12px; white chip over dark backgrounds, black chip over light ones */
.agent-orb-label { font-size: 12px !important; color: #000; background: #fff; }
.agent-orb.is-on-light .agent-orb-label { color: #fff; background: #0a0a0a; }
