/* Ask Ali: compact, page-aware portfolio assistant. */
.askali-root {
  position: fixed;
  z-index: 160;
  right: 24px;
  bottom: 24px;
  font-family: "Instrument Sans", "Plus Jakarta Sans", sans-serif;
  color: var(--home-ink, #121316);
}

.askali-root button,
.askali-root textarea {
  font: inherit;
}

.askali-ribbon {
  position: relative;
  display: flex;
  align-items: center;
  width: 204px;
  height: 56px;
  padding: 0 30px 0 17px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px 4px 10px 10px;
  color: #fffdf9;
  background: #121316;
  box-shadow: 0 9px 24px rgba(17, 18, 20, .2);
  cursor: pointer;
  text-align: left;
  transition: transform 240ms cubic-bezier(.22, 1, .36, 1), box-shadow 240ms ease;
}

.askali-ribbon:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 18, 20, .24);
}

.askali-ribbon:active { transform: translateY(0); }

.askali-root[data-state="open"] .askali-ribbon,
.askali-root[data-state="conversation"] .askali-ribbon {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.askali-ribbon-copy {
  display: grid;
  gap: 3px;
  position: relative;
  z-index: 1;
}
.askali-ribbon-compact { display: none; }

.askali-ribbon-copy strong {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.askali-ribbon-copy small {
  color: #c5c3bf;
  font-size: 10px;
  line-height: 1.2;
}

.askali-ribbon-edge {
  position: absolute;
  top: 0;
  right: 0;
  width: 27px;
  height: 100%;
  background: var(--home-coral, #f05c45);
  clip-path: polygon(34% 0, 100% 0, 100% 100%, 0 100%, 53% 54%);
}

.askali-ribbon:focus-visible,
.askali-root button:focus-visible,
.askali-root textarea:focus-visible {
  outline: 3px solid var(--home-coral, #f05c45);
  outline-offset: 3px;
}

.askali-preview {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 326px;
  padding: 16px;
  border: 1px solid #e4e0d8;
  border-radius: 18px;
  background: var(--home-card, #fffdf9);
  box-shadow: 0 16px 40px rgba(24, 22, 18, .16);
  transform-origin: 90% 100%;
  animation: askali-preview-in 240ms cubic-bezier(.22, 1, .36, 1) both;
}

.askali-preview[hidden] { display: none !important; }

.askali-preview-head,
.askali-preview-head > div {
  display: flex;
  align-items: center;
}

.askali-preview-head { justify-content: space-between; }
.askali-preview-head > div { gap: 9px; }
.askali-preview-head strong { font: 700 14px/1.2 "Plus Jakarta Sans", sans-serif; letter-spacing: -.03em; }
.askali-preview-head span { display: inline-flex; align-items: center; gap: 5px; color: #6f7479; font-size: 10px; }
.askali-preview-head i { width: 6px; height: 6px; border-radius: 50%; background: #39a66a; }

.askali-preview-close,
.askali-icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #41454a;
  background: transparent;
  cursor: pointer;
  font-size: 21px !important;
  line-height: 1;
}

.askali-preview-close:hover,
.askali-icon-button:hover { background: #f0ede7; }
.askali-preview-title { margin: 13px 0 11px; font: 700 16px/1.25 "Plus Jakarta Sans", sans-serif; letter-spacing: -.045em; }

.askali-preview-prompts,
.askali-prompt-list { display: grid; gap: 7px; }

.askali-preview-question,
.askali-prompt,
.askali-followup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e4e0d8;
  border-radius: 12px;
  color: #282a2d;
  background: #fffefa;
  cursor: pointer;
  text-align: left;
  font-size: 12px !important;
  line-height: 1.35;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.askali-preview-question:hover,
.askali-prompt:hover,
.askali-followup:hover { border-color: #efaa9d; background: #fff8f5; transform: translateY(-1px); }
.askali-preview-question > span:last-child,
.askali-prompt > span:last-child,
.askali-followup > span { color: var(--home-coral, #f05c45); font-size: 16px; flex: 0 0 auto; }

.askali-open-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #121316;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.askali-open-button span { color: #ff9a86; font-size: 16px; }

.askali-panel-host { position: static; }

.askali-lens {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  width: min(520px, calc(100vw - 48px));
  height: min(560px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid #e2ded6;
  border-radius: 22px;
  color: var(--home-ink, #121316);
  background: var(--home-card, #fffdf9);
  box-shadow: 0 18px 56px rgba(23, 22, 20, .2);
  transform-origin: 92% 100%;
  animation: askali-lens-in 320ms cubic-bezier(.22, 1, .36, 1) both;
}

.askali-lens[hidden] { display: none !important; }

.askali-lens.is-welcome { height: auto; }
.askali-lens.is-welcome .askali-body { flex: 0 0 auto; overflow: visible; }

.askali-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 13px 16px 13px 18px;
  border-bottom: 1px solid #e9e5dd;
  background: #fffdf9;
}

.askali-title-lockup { display: flex; align-items: center; gap: 11px; }
.askali-title-lockup h2 { margin: 0; font: 700 15px/1.15 "Plus Jakarta Sans", sans-serif; letter-spacing: -.04em; }
.askali-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: var(--home-coral, #f05c45); font: 700 15px/1 "Plus Jakarta Sans", sans-serif; }
.askali-status { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: #747a7f; font-size: 10px; }
.askali-status > span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #39a66a; }
.askali-status [data-askali-status] { display: inline; }
.askali-status [data-askali-status="Thinking…"] { color: #8b6258; }
.askali-header-actions { display: flex; align-items: center; gap: 2px; }
.askali-settings-button { font-size: 24px !important; letter-spacing: 1px; }

.askali-sheet-handle {
  display: none;
  width: 42px;
  height: 4px;
  margin: 9px auto 2px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #c9c5be;
  cursor: grab;
}

.askali-menu {
  position: absolute;
  z-index: 5;
  top: 63px;
  right: 62px;
  width: 205px;
  padding: 8px;
  border: 1px solid #e4e0d8;
  border-radius: 13px;
  background: #fffefa;
  box-shadow: 0 12px 28px rgba(24, 22, 18, .15);
}

.askali-menu[hidden] { display: none !important; }
.askali-menu-title { margin: 5px 8px 7px; color: #777b80; font: 600 9px/1.4 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.askali-menu-copy { margin: 0 8px 8px; color: #5d6268; font-size: 11px; line-height: 1.45; }
.askali-menu-item { display: block; width: 100%; min-height: 38px; padding: 8px; border: 0; border-radius: 8px; color: #27292c; background: transparent; cursor: pointer; text-align: left; font-size: 11px !important; }
.askali-menu-item:hover { background: #f4f1eb; }

.askali-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.askali-welcome { padding: 22px 20px 20px; }
.askali-eyebrow { margin: 0 0 8px; color: #72777d; font: 600 9px/1.4 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.askali-welcome h3 { margin: 0; font: 700 23px/1.12 "Plus Jakarta Sans", sans-serif; letter-spacing: -.06em; }
.askali-welcome > p:not(.askali-eyebrow) { margin: 8px 0 17px; color: #666c72; font-size: 12px; line-height: 1.45; }
.askali-prompt { min-height: 46px; padding: 11px 13px; border-radius: 12px; font-size: 12px !important; }

.askali-conversation {
  height: 100%;
  overflow-y: auto;
  padding: 18px 20px 20px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.askali-turn { padding: 0 0 17px; }
.askali-turn + .askali-turn { padding-top: 15px; border-top: 1px solid #ece8e1; }
.askali-turn-label { margin: 0 0 6px; color: #7b7e82; font: 600 9px/1.4 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.askali-user-question { margin: 0; color: #242629; font: 600 14px/1.45 "Plus Jakarta Sans", sans-serif; }
.askali-answer { margin: 0; color: #43484d; font-size: 13px; line-height: 1.58; }
.askali-answer > * { margin: 0; }
.askali-answer > * + * { margin-top: 9px; }
.askali-answer h4 {
  color: #c74d37;
  font: 700 13px/1.35 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -.02em;
}
.askali-answer strong { color: #c74d37; font-weight: 700; }
.askali-answer em { color: #5c6268; }
.askali-answer ol,
.askali-answer ul { padding-left: 20px; }
.askali-answer li { padding-left: 2px; }
.askali-answer li + li { margin-top: 7px; }
.askali-answer li::marker { color: var(--home-coral, #f05c45); font-weight: 700; }
.askali-answer code {
  padding: 2px 5px;
  border: 1px solid #e7ddd5;
  border-radius: 5px;
  color: #a44130;
  background: #fff5f1;
  font: 500 .9em/1.4 "JetBrains Mono", monospace;
}
.askali-related { margin-top: 13px; }
.askali-related-label { margin: 0 0 7px; color: #757a7e; font: 600 9px/1.4 "JetBrains Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.askali-related-card { display: grid; grid-template-columns: 30px 1fr; align-items: start; gap: 9px; padding: 11px; border: 1px solid #e5e1d9; border-radius: 12px; background: #fbf9f4; }
.askali-related-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--home-coral, #f05c45); background: #fff; font-size: 16px; }
.askali-related-card strong { display: block; color: #292b2e; font: 700 12px/1.3 "Plus Jakarta Sans", sans-serif; }
.askali-related-card small { display: -webkit-box; overflow: hidden; margin-top: 3px; color: #777b80; font-size: 10px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.askali-show-source { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 42px; margin-top: 7px; padding: 0 12px; border: 1px solid #eaa395; border-radius: 11px; color: #b74734; background: #fffefa; cursor: pointer; font-size: 11px !important; font-weight: 700 !important; }
.askali-show-source:hover { background: #fff4f0; }
.askali-show-source span { color: var(--home-coral, #f05c45); font-size: 15px; }
.askali-followups { display: grid; gap: 6px; margin-top: 10px; }
.askali-followup { min-height: 38px; padding: 8px 10px; border-radius: 10px; font-size: 11px !important; }
.askali-loading { margin: 0 0 15px; color: #777b80; font-size: 11px; }

.askali-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 11px 13px;
  border-top: 1px solid #e9e5dd;
  background: #fffdf9;
}

.askali-composer textarea {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 128px;
  resize: none;
  padding: 12px 13px;
  border: 1px solid #e2ded6;
  border-radius: 14px;
  outline: none;
  color: #282a2d;
  background: #fffefa;
  font-size: 12px;
  line-height: 1.4;
}

.askali-composer textarea:focus { border-color: #e59888; box-shadow: 0 0 0 2px rgba(240, 92, 69, .1); }
.askali-composer textarea::placeholder { color: #8b8e91; }
.askali-send-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 13px; color: white; background: var(--home-coral, #f05c45); cursor: pointer; font-size: 23px !important; line-height: 1; }
.askali-send-button:disabled { color: #fff; background: #d7a096; cursor: not-allowed; }
.askali-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.askali-source-highlight {
  position: relative;
  outline: 2px solid var(--home-coral, #f05c45) !important;
  outline-offset: 5px;
  border-radius: 10px;
  transition: outline-color 250ms ease, outline-offset 250ms ease;
}

.askali-source-highlight::before {
  content: attr(data-askali-source-label);
  position: absolute;
  z-index: 3;
  top: 9px;
  left: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--home-coral, #f05c45);
  font: 600 9px/1.2 "JetBrains Mono", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

@keyframes askali-preview-in {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes askali-lens-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
  .askali-root {
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .askali-ribbon { width: clamp(150px, 48vw, 176px); height: 52px; padding-left: 14px; }
  .askali-ribbon-copy strong { font-size: 13px; }
  .askali-ribbon-copy small { font-size: 9px; }
  .askali-preview { width: min(330px, calc(100vw - 24px)); padding: 14px; border-radius: 18px; }

  .askali-lens {
    top: auto;
    right: 8px;
    bottom: var(--askali-vv-bottom, max(8px, env(safe-area-inset-bottom, 0px)));
    left: 8px;
    width: auto;
    height: min(62dvh, calc(var(--askali-vv-height, 100dvh) - 24px));
    max-height: min(85dvh, calc(var(--askali-vv-height, 100dvh) - 16px));
    border-radius: 24px;
    animation-name: askali-sheet-in;
  }

  .askali-lens.is-welcome { height: min(62dvh, calc(var(--askali-vv-height, 100dvh) - 24px)); }
  .askali-lens.is-welcome .askali-body { flex: 1 1 auto; overflow: hidden; }
  .askali-sheet-handle { display: block; flex: 0 0 auto; }
  .askali-header { min-height: 64px; padding: 8px 12px 11px; }
  .askali-header-actions { gap: 0; }
  .askali-icon-button { width: 40px; height: 40px; }
  .askali-minimize-button { display: none; }
  .askali-menu { top: 67px; right: 52px; }
  .askali-welcome { padding: 18px 16px 16px; }
  .askali-welcome h3 { font-size: 20px; }
  .askali-conversation { padding: 15px 16px 16px; }
  .askali-composer { padding: 10px 11px max(10px, env(safe-area-inset-bottom, 0px)); }
}

@keyframes askali-sheet-in {
  from { opacity: .8; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .askali-root *,
  .askali-root *::before,
  .askali-root *::after,
  .askali-source-highlight {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* A small, labeled target leaves narrow-screen portfolio content visible. */
@media (max-width: 760px) {
  body .askali-root .askali-ribbon { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; background: #292632; }
  body .askali-ribbon .askali-ribbon-copy, body .askali-ribbon-edge { display: none; }
  body .askali-ribbon .askali-ribbon-compact { display: block; font-size: 12px; font-weight: 500; }
}
