/* "Ask about my work" — search over the case-study index. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* Spam trap in the message form: off-screen and never focused by people. */
.ask-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ask-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
}
.ask-launcher:hover {
  background: var(--accent-soft);
}
.ask-launcher-icon {
  display: none;
  flex: none;
}
/* Below 1760px the full pill would cover the right edge of the content
   column (cards, tables, links), so it shrinks to a round icon button. The
   label is kept for screen readers; the title attribute shows it on hover. */
@media (max-width: 1759px) {
  .ask-launcher {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
  }
  .ask-launcher-icon {
    display: block;
  }
  .ask-launcher-label,
  .ask-launcher kbd {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.ask-launcher kbd {
  font:
    10px ui-monospace,
    monospace;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 5px;
  color: var(--text-muted);
}

.ask-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 10, 14, 0.62);
  display: grid;
  place-items: start center;
  padding: 10vh 20px 20px;
}
.ask-backdrop[hidden] {
  display: none;
}

.ask-panel {
  width: min(640px, 100%);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.ask-head {
  padding: 20px 22px 0;
}
.ask-head h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.ask-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.6;
}
.ask-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 6px;
}
.ask-close:hover {
  color: var(--accent);
}
.ask-panel {
  position: relative;
}

.ask-field {
  padding: 16px 22px 12px;
}
.ask-field input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 12px 14px;
}
.ask-field input::placeholder {
  color: var(--text-muted);
}
.ask-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 22px 14px;
}
.ask-chips button,
.ask-retry {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-body);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 11.5px;
}
.ask-chips button:hover,
.ask-retry:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ask-results {
  overflow-y: auto;
  padding: 0 12px 8px;
  border-top: 1px solid var(--border);
}
.ask-hit {
  display: block;
  padding: 15px 14px;
  border-radius: 6px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.ask-hit:last-child {
  border-bottom: 0;
}
.ask-hit:hover,
.ask-hit:focus,
.ask-hit:focus-visible {
  background: var(--bg-raised);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.ask-hit-meta {
  font:
    10px ui-monospace,
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 7px;
}
.ask-hit strong {
  display: block;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.015em;
}
.ask-hit span {
  display: block;
  font-size: 12.5px;
  color: var(--text-body);
  margin-top: 6px;
  line-height: 1.6;
}
.ask-hit mark {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}
.ask-empty {
  padding: 26px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.ask-foot {
  border-top: 1px solid var(--border);
  padding: 13px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.ask-foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.ask-foot a:hover {
  text-decoration: underline;
}

.ask-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 22px 0;
  padding: 3px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.ask-tab {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font:
    600 12px "Inter",
    sans-serif;
  padding: 8px 10px;
  border-radius: 999px;
}
.ask-tab.active {
  background: var(--accent);
  color: var(--bg);
}
.ask-tab:not(.active):hover {
  color: var(--text);
}
.ask-tab kbd {
  font:
    10px ui-monospace,
    monospace;
  border: 1px solid currentColor;
  opacity: 0.6;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 4px;
}
.ask-link {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.ask-link:hover {
  text-decoration: underline;
}
.ask-empty .ask-link {
  display: block;
  margin-top: 8px;
}

.ask-msg-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 46vh;
}
.ask-msg {
  max-width: 90%;
  font-size: 12.5px;
  line-height: 1.5;
}
.ask-msg.bot {
  align-self: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 3px;
  padding: 9px 12px;
  color: var(--text-body);
}
.ask-msg.bot b {
  color: var(--text);
}
.ask-msg.user {
  align-self: flex-end;
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 12px 12px 3px 12px;
  padding: 9px 12px;
  font-weight: 550;
}
.ask-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 3px;
}
.ask-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: ask-typing-bounce 1.1s ease-in-out infinite;
}
.ask-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.ask-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes ask-typing-bounce {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}
.ask-recap {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
}
.ask-recap dt {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}
.ask-recap dt:first-child {
  margin-top: 0;
}
.ask-recap dd {
  margin: 1px 0 0;
  color: var(--text);
  font-weight: 550;
}

.ask-msg-foot {
  border-top: 1px solid var(--border);
  padding: 12px 22px;
}
.ask-field-row {
  display: flex;
  gap: 8px;
}
.ask-field-row input,
.ask-field-row textarea {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 12.5px;
  resize: none;
}
.ask-field-row input:focus-visible,
.ask-field-row textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.ask-send {
  border: none;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  padding: 0 14px;
  font:
    600 12px "Inter",
    sans-serif;
  cursor: pointer;
  flex-shrink: 0;
}
.ask-send:hover {
  background: var(--accent-bright);
  color: var(--text-on-accent-bright);
}
.ask-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ask-chip {
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font:
    550 12px "Inter",
    sans-serif;
  cursor: pointer;
}
.ask-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ask-err {
  color: var(--danger);
  font-size: 11px;
  margin: 6px 2px 0;
}
.ask-sending {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0;
}
.ask-foot-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 10px;
}
.ask-link-btn {
  border: none;
  background: none;
  color: var(--text-muted);
  font: 12px "Inter", sans-serif;
  cursor: pointer;
  padding: 4px;
  text-decoration: none;
}
.ask-link-btn:hover {
  color: var(--accent);
}

.ask-privacy {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.ask-privacy a {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .ask-typing span {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .ask-launcher {
    right: 14px;
    bottom: 14px;
  }
  .ask-backdrop {
    padding: 0;
    place-items: stretch;
  }
  .ask-panel {
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    border: 0;
    width: 100%;
  }
}

@media print {
  .ask-launcher,
  .ask-backdrop {
    display: none !important;
  }
}

/* Keep the contact entry point legible on desktop rather than an unexplained icon. */
@media(min-width:768px) and (max-width:1759px) { .ask-launcher { width: auto; padding: 10px 14px; } .ask-launcher-label { position: static; width: auto; height: auto; clip: auto; overflow: visible; white-space: nowrap; } }

/* Leave a clear dock below footer controls for the fixed contact launcher. */
@media screen { body:has(.ask-launcher) footer { padding-bottom: 176px; } }

/* A gentle glow keeps the contact entry point visible without flashing text. */
@media screen and (prefers-reduced-motion: no-preference) {
  .ask-launcher:not(.is-quiet) { animation: contact-breathe 5.5s ease-in-out infinite; }
  .ask-end-note { animation: contact-note-in .35s ease-out both; }
}
@keyframes contact-breathe {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft), 0 10px 30px -12px rgba(0,0,0,.5); }
  50% { box-shadow: 0 0 0 6px var(--accent-soft), 0 0 24px var(--accent-soft); }
}
@keyframes contact-note-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ask-page-end { height: 1px; pointer-events: none; }
.ask-end-note {
  position: fixed; right: 22px; bottom: 82px; z-index: 59;
  width: min(300px, calc(100vw - 28px)); box-sizing: border-box;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg); color: var(--text); box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.ask-end-note[hidden] { display: none; }
.ask-end-note p { margin: 0; font-size: 14px; line-height: 1.5; }
.ask-end-note small { display: block; color: var(--text-muted); font-size: 12px; }
.ask-end-note button { flex: none; width: 44px; height: 44px; margin-left: auto; padding: 0; font-size: 20px; border: 0; background: transparent; color: var(--text-muted); }

@media(max-width:640px) { .ask-end-note { right: 14px; bottom: 74px; } }
@media print { .ask-end-note, .ask-page-end { display: none !important; } }

.motion-paused .ask-end-note { animation: none; }
@media(max-width:767px) { body:has(.lp-quiz-nudge.is-open) .ask-launcher { visibility: hidden; } }
