/* 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.06);
  background: #131313;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.ask-prompt:hover {
  background: #171717;
  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(0, 166, 119, 0.07);
}

.ask-prompt--green .ask-prompt-text {
  color: #00a677;
}

.ask-prompt--orange {
  border-color: rgba(166, 119, 0, 0.07);
}

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

.ask-prompt--pink {
  border-color: rgba(166, 0, 99, 0.07);
}

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

.ask-prompt--blue {
  border-color: rgba(0, 91, 166, 0.07);
}

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

.ask-prompt--purple {
  border-color: rgba(83, 0, 166, 0.07);
}

.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%, #0c0c0c 36%, #0c0c0c 100%);
  pointer-events: none;
}

.ask-footer .ask-form {
  pointer-events: auto;
}

.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 #202020;
  background: #0d0d0d;
}

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

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

.ask-send {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #131313;
  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: #1a1a1a;
}

.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: #131313;
  border: 1px solid #202020;
  color: rgba(255, 255, 255, 0.92);
  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.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  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: rgba(255, 255, 255, 0.94);
  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: rgba(255, 255, 255, 0.94);
  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: #ffffff;
  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: rgba(255, 255, 255, 0.72);
  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.1);
}

.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: rgba(255, 255, 255, 0.88);
  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: rgba(255, 255, 255, 0.45);
  font-size: 14px;
  line-height: 1;
  transition: color 0.2s ease;
}

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

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

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

.ask-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-top: 6px;
}

.ask-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(168, 168, 168, 0.85);
  animation: askTyping 1.2s 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 askTyping {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@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-typing span {
    animation: none;
    opacity: 0.7;
  }

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