/* Ask Me — Figma layout (Portfolio_WIP · Ask) */

body[data-page="ask"] {
  overflow: hidden;
  background-color: #0d0d0d;
  --ask-input-offset: calc(76px + env(safe-area-inset-bottom, 0px));
}

.ask-dotted-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.65;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.4) calc(var(--site-header-height) - 8px),
    #000 calc(var(--site-header-height) + 28px),
    #000 calc(100% - var(--ask-input-offset) - 32px),
    rgba(0, 0, 0, 0.4) calc(100% - var(--ask-input-offset)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.4) calc(var(--site-header-height) - 8px),
    #000 calc(var(--site-header-height) + 28px),
    #000 calc(100% - var(--ask-input-offset) - 32px),
    rgba(0, 0, 0, 0.4) calc(100% - var(--ask-input-offset)),
    transparent 100%
  );
}

.ask-dotted-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    #0d0d0d 0%,
    rgba(13, 13, 13, 0.5) calc(var(--site-header-height) + 4px),
    transparent 38%,
    transparent 62%,
    rgba(12, 12, 12, 0.5) calc(100% - var(--ask-input-offset) - 4px),
    #0c0c0c 100%
  );
  pointer-events: none;
}

body[data-page="ask"] .site-header {
  position: sticky;
  z-index: 100;
}

body[data-page="ask"] .ask-page {
  z-index: 1;
}

body[data-page="ask"]::before,
body[data-page="ask"]::after {
  display: none;
}

.ask-page {
  position: relative;
  height: calc(100dvh - var(--site-header-height));
  background: transparent;
  --ask-input-offset: calc(76px + env(safe-area-inset-bottom, 0px));
  --ask-input-gap: 40px;
}

.ask-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 16vw calc(var(--ask-input-offset) + var(--ask-input-gap));
}

.ask-scroll-content {
  width: 100%;
}

.ask-page.is-empty .ask-scroll-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--site-header-height) - var(--ask-input-offset));
}

.ask-empty {
  width: 100%;
  max-width: 741px;
  margin: 0 auto;
}

.ask-page:not(.is-empty) .ask-empty {
  display: none;
}

.ask-messages[hidden] {
  display: none !important;
}

.ask-page.is-empty .ask-empty {
  transform: translateY(-2.5rem);
}

.ask-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.ask-heading {
  margin: 0;
  font-family: 'Denton Test', 'Denton', 'Playfair Display', serif;
  font-size: clamp(32px, 4.2vw, 46px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.ask-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
}

.ask-prompt {
  appearance: none;
  width: calc((100% - 48px) / 4);
  min-width: 200px;
  max-width: 230px;
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
  border-radius: 4.5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #131313;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.ask-prompt:hover {
  background: #171717;
  border-color: rgba(255, 255, 255, 0.06);
  
  transform: translateY(-1px);
}

.ask-prompt-icon {
  width: 23px;
  height: 23px;
  display: block;
  flex-shrink: 0;
}

.ask-prompt-text {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.ask-prompt--green {
  border-color: rgba(45, 138, 106, 0.2);
}

.ask-prompt--green .ask-prompt-text {
  color: #2d8a6a;
}

.ask-prompt--orange {
  border-color: rgba(212, 104, 79, 0.2);
}

.ask-prompt--orange .ask-prompt-text {
  color: #e68950;
}

.ask-prompt--pink {
  border-color: #d337763d;
}

.ask-prompt--pink .ask-prompt-text {
  color: #d33776;
}

.ask-prompt--blue {
  border-color: #698cff2e;
}

.ask-prompt--blue .ask-prompt-text {
  color: #698cff;
}

.ask-prompt--purple {
  border-color: #a764e72e;
}

.ask-prompt--purple .ask-prompt-text {
  color: #a764e7;
}

.ask-messages {
  max-width: 741px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 24px;
}

.ask-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: 100%;
  padding: 16px 16vw calc(20px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(13, 13, 13, 0) 0%, #0d0d0d 36%, #0d0d0d 100%);
  pointer-events: none;
}

.ask-form {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 741px;
  margin: 0 auto;
  padding: 10px 10px 10px 20px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #131313;
  box-shadow: none;
}

.ask-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.11;
  padding: 6px 0;
  outline: none;
}

.ask-input::placeholder {
  color: #969696;
}

.ask-send {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #111111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.ask-send:hover:not(:disabled) {
  background: #202020;
}

.ask-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ask-send img {
  display: block;
  width: 10px;
  height: 10px;
}

.ask-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  scroll-margin-top: 24px;
}

.ask-message--user {
  justify-content: flex-end;
}

.ask-message--user .ask-message-body {
  max-width: min(85%, 520px);
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.6;
}

.ask-message--assistant .ask-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #111111;
  color: #4bc1c8;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.ask-message--assistant .ask-message-content {
  flex: 1;
  min-width: 0;
}

.ask-message--assistant .ask-message-body {
  padding-top: 4px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.ask-message--assistant .ask-message-body strong {
  color: #ffffff;
  font-weight: 600;
}

.ask-message-body a.ask-email-link {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.ask-message-body a.ask-email-link:hover {
  color: #4bc1c8;
  opacity: 0.92;
}

.ask-message--streaming .ask-message-body::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.08em;
  background: #4bc1c8;
  animation: askStreamCursor 0.9s step-end infinite;
}

@keyframes askStreamCursor {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.ask-followups {
  margin-top: 20px;
  margin-bottom: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ask-followup {
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #d9d9d9;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ask-followup:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ask-followup:hover {
  color: rgba(244, 208, 63, 0.95);
}

.ask-followup-arrow {
  flex-shrink: 0;
  margin-top: 2px;
  color: #969696;
  font-size: 14px;
  line-height: 1;
  transition: color 0.2s ease;
}

.ask-followup:hover .ask-followup-arrow {
  color: #e68950;
}

.ask-followup-text {
  flex: 1;
  min-width: 0;
}

.ask-message--error .ask-message-body {
  color: rgba(217, 217, 217, 0.72);
}

/* The orb stands in for the avatar while we wait, so it lines up with the
   avatar of the reply that replaces it, and the label with the reply text. */
.ask-thinking {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.ask-thinking-orb {
  display: inline-flex;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-left: -4px;
}

.ask-thinking-orb .thinking-orb {
  display: block;
}

/* Light sweeps left-to-right across the label while the orb spins. */
.ask-thinking-label {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #808080;
  background: linear-gradient(
    90deg,
    #808080 0%,
    #808080 40%,
    #ffffff 50%,
    #808080 60%,
    #808080 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: askThinkingShimmer 2.2s linear infinite;
}

@keyframes askThinkingShimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

@media (max-width: 780px) {
  .ask-page.is-empty .ask-scroll-content {
    display: block;
    min-height: 0;
    padding-top: 20px;
    padding-bottom: 8px;
  }

  .ask-page.is-empty .ask-empty {
    transform: none;
  }

  .ask-hero {
    gap: 20px;
  }

  .ask-prompts {
    flex-direction: column;
  }

  .ask-prompt {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex-basis: auto;
  }
}

@media (max-width: 900px) {
  .ask-scroll {
    padding-left: 6vw;
    padding-right: 6vw;
  }

  .ask-footer {
    padding-left: 6vw;
    padding-right: 6vw;
  }
}

@media (max-width: 600px) {
  .ask-scroll {
    padding-left: 20px;
    padding-right: 20px;
  }

  .ask-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .ask-prompt {
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }

  .ask-heading {
    font-size: clamp(28px, 8vw, 36px);
  }

  .ask-form {
    padding-left: 16px;
  }

  .ask-input {
    font-size: 16px;
  }

  .ask-message--user .ask-message-body {
    max-width: 92%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ask-thinking-label {
    animation: none;
    background: none;
    -webkit-text-fill-color: currentColor;
  }

  .ask-prompt:hover {
    transform: none;
  }
}
