/* ====================================
   Aria Chat Interface Component
   ==================================== */

/* Services Section */
.services-section {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: var(--bg-page);
  /* Scroll reveal — slides up into view */
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.services-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

.services-section .container {
  max-width: 800px;
  position: relative;
  z-index: 2;
}

.services-header {
  text-align: center;
  margin-bottom: 48px;
}

/* Aria Input Container */
.aria-input-container {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.aria-input-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 60px;
  padding: 8px 8px 8px 28px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  position: relative;
}

.aria-input-box:focus-within {
  border-color: var(--text-primary);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

.aria-input-box.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.aria-input-field {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary);
  padding: 12px 0;
  caret-color: var(--text-primary);
  min-width: 0;
}

.aria-input-field::placeholder {
  color: var(--text-muted);
}

/* Blinking vertical caret hint */
.aria-caret {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 22px;
  background: var(--text-primary);
  border-radius: 1px;
  animation: caretBlink 1s step-end infinite;
  pointer-events: none;
  opacity: 0.7;
}

.aria-caret.hidden {
  display: none;
}

@keyframes caretBlink {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0; }
}

.aria-mic-btn,
.aria-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
}

.aria-mic-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}

.aria-mic-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg-page);
}

.aria-send-btn {
  background: var(--black);
  border: none;
}

.aria-send-btn:hover {
  background: var(--text-primary);
  transform: scale(1.05);
}

.aria-send-btn svg {
  color: var(--white);
}

/* Aria Suggestions — Single Rotating Typewriter Chip */
.aria-suggestions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  min-height: 38px;
  opacity: 1;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.aria-suggestions.hidden {
  opacity: 0;
  pointer-events: none;
}

.aria-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 450;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease,
              color 0.25s, background 0.25s;
  letter-spacing: 0.1px;
}

.aria-suggestion .chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.25s;
}

.aria-suggestion:hover .chip-icon {
  opacity: 0.7;
}

.aria-suggestion.typing {
  opacity: 1;
  transform: translateY(0);
}

.aria-suggestion.fading {
  opacity: 0;
  transform: translateY(-8px);
}

.aria-suggestion .chip-cursor {
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  background: var(--text-muted);
  margin-left: 1px;
  vertical-align: text-bottom;
  border-radius: 1px;
  animation: chipCursorBlink 0.6s step-end infinite;
  opacity: 0.6;
}

@keyframes chipCursorBlink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0; }
}

.aria-suggestion:hover {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.03);
}

/* Aria Expanded Chat Window */
.aria-expanded {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-page);
  z-index: 150;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.aria-expanded.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Aria Expanded Header */
.aria-expanded-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(251, 249, 239, 0.95);
  backdrop-filter: blur(12px);
}

.aria-expanded-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aria-expanded-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'Instrument Serif', serif;
  font-size: 16px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.aria-expanded-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aria-expanded-title {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  color: var(--text-primary);
}

.aria-expanded-title span {
  color: var(--text-muted);
  font-style: italic;
}

.aria-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  color: var(--text-muted);
}

.aria-close-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: var(--bg-card);
}

/* Aria Messages */
.aria-messages {
  flex: 1;
  overflow-y: auto;
  padding: 40px max(32px, calc(50% - 440px));
  display: flex;
  flex-direction: column;
  gap: 28px;
  scroll-behavior: smooth;
}

.aria-messages::-webkit-scrollbar {
  width: 4px;
}

.aria-messages::-webkit-scrollbar-track {
  background: transparent;
}

.aria-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.aria-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.18);
}

.aria-user-query {
  align-self: flex-end;
  max-width: 68%;
  padding: 14px 22px;
  background: linear-gradient(145deg, #1c1c1c 0%, #0f0f0f 100%);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 20px 20px 4px 20px;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  animation: msgAppear 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes msgAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.aria-response {
  display: flex;
  gap: 16px;
  max-width: 85%;
  opacity: 0;
  transform: translateY(20px);
  animation: msgAppear 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

.aria-response-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f6f4ee 0%, #eae7dc 100%);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-primary);
  font-family: 'Instrument Serif', serif;
  font-size: 16px;
  overflow: hidden;
}

.aria-response-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aria-response-content {
  flex: 1;
}

.aria-response-label {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.38);
  letter-spacing: 0.02em;
  margin-bottom: 7px;
  padding-left: 2px;
  text-transform: uppercase;
}

.aria-response-bubble {
  background: #ffffff;
  border: none;
  border-radius: 4px 18px 18px 18px;
  padding: 18px 24px;
  font-size: 15px;
  line-height: 1.8;
  color: #1a1a1a;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.aria-response-bubble p {
  margin-bottom: 14px;
}

.aria-response-bubble p:last-child {
  margin-bottom: 0;
}

.aria-response-bubble strong {
  font-weight: 600;
  color: #111111;
}

.aria-response-bubble ul,
.aria-response-bubble ol {
  margin: 8px 0 14px 20px;
}

.aria-response-bubble li {
  margin-bottom: 6px;
  line-height: 1.7;
}

.aria-response-bubble li:last-child {
  margin-bottom: 0;
}

/* Aria Typing Indicator */
.aria-typing {
  display: flex;
  gap: 16px;
  max-width: 85%;
  opacity: 0;
  transform: translateY(20px);
  animation: msgAppear 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.aria-typing-dots {
  display: flex;
  gap: 6px;
  padding: 18px 22px;
  background: #ffffff;
  border: none;
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.04);
  align-items: center;
}

.aria-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa;
  animation: typingBounce 1.4s infinite;
}

.aria-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.aria-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Streaming cursor */
.aria-stream-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.aria-stream-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #555;
  margin-left: 2px;
  vertical-align: text-bottom;
  border-radius: 1px;
  animation: caretBlink 0.7s step-end infinite;
}

/* Aria Response CTA */
.aria-response-cta {
  margin-top: 14px;
}

.aria-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #111111;
  color: rgba(255, 255, 255, 0.92);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  letter-spacing: 0.01em;
}

.aria-cta-btn:hover {
  background: #2a2a2a;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.aria-cta-btn svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* Markdown elements inside response bubble */
.aria-response-bubble h3.aria-md-h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
  font-weight: 400;
  color: #111;
  margin: 0 0 12px;
  line-height: 1.4;
}

.aria-response-bubble h4.aria-md-h2 {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.aria-response-bubble h5.aria-md-h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 12px 0 6px;
}

.aria-response-bubble .aria-md-ul,
.aria-response-bubble .aria-md-ol {
  margin: 6px 0 14px 4px;
  padding-left: 18px;
}

.aria-response-bubble .aria-md-ul li,
.aria-response-bubble .aria-md-ol li {
  margin-bottom: 7px;
  line-height: 1.65;
  padding-left: 2px;
}

.aria-response-bubble .aria-md-ul li:last-child,
.aria-response-bubble .aria-md-ol li:last-child {
  margin-bottom: 0;
}

.aria-response-bubble .aria-md-hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 16px 0;
}

.aria-response-bubble .aria-md-code {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #c0392b;
}

/* Aria Followup Buttons */
.aria-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  opacity: 0;
  transform: translateY(10px);
  animation: msgAppear 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
}

.aria-followup {
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.aria-followup:hover {
  border-color: rgba(0, 0, 0, 0.22);
  color: var(--text-primary);
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

/* Aria Expanded Input */
.aria-expanded-input {
  padding: 20px 32px 28px;
  border-top: 1px solid var(--border-light);
  background: rgba(251, 249, 239, 0.95);
  backdrop-filter: blur(12px);
}

.aria-expanded-input-box {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  padding: 12px 12px 12px 24px;
  max-width: 880px;
  margin: 0 auto;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.aria-expanded-input-box:focus-within {
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
}

.aria-expanded-textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  resize: none;
  line-height: 1.5;
  max-height: 120px;
  padding: 8px 0;
}

.aria-expanded-textarea::placeholder {
  color: var(--text-muted);
}

.aria-expanded-mic,
.aria-expanded-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
}

.aria-expanded-mic {
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text-muted);
}

.aria-expanded-mic:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.aria-expanded-send {
  background: var(--black);
  border: none;
}

.aria-expanded-send:hover {
  background: #333;
  transform: scale(1.05);
}

.aria-expanded-send svg {
  color: white;
}

.aria-input-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ====================================
   Notification Card — iOS style, below chip
   ==================================== */
.aria-notif {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  z-index: 10;
  width: 320px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13), 0 2px 8px rgba(0, 0, 0, 0.07);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.aria-notif.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.aria-notif.hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* App icon — squircle */
.aria-notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.aria-notif-icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

/* Text */
.aria-notif-content {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.aria-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.aria-notif-app {
  font-size: 11px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.42);
  letter-spacing: 0;
  text-transform: none;
}

.aria-notif-time {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.32);
  font-weight: 400;
}

.aria-notif-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.88);
  line-height: 1.35;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aria-notif-body {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.48);
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Ensure container has room below for the notification */
.aria-input-container {
  padding-bottom: 16px;
}

@media (max-width: 480px) {
  .aria-notif {
    width: calc(100% - 32px);
    left: 16px;
    transform: translateY(14px);
  }
  .aria-notif.visible {
    transform: translateY(0);
  }
  .aria-notif.hiding {
    transform: translateY(-8px);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .aria-expanded {
    top: auto;
    bottom: 0;
    height: 90vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.15);
    background: rgba(251, 249, 239, 0.98);
  }

  .aria-expanded.open {
    transform: translateY(0);
  }

  .aria-expanded::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    z-index: 20;
  }

  .aria-expanded-header {
    border-radius: 24px 24px 0 0;
    padding: 32px 20px 20px;
  }
}

@media (max-width: 600px) {
  .services-section {
    padding: 80px 0 60px;
  }

  .services-section .container {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
  }

  .services-header {
    margin-bottom: 32px;
  }

  .services-section .section-title {
    font-size: clamp(24px, 6.5vw, 34px);
  }

  .services-section .section-subtitle {
    font-size: 13px;
    line-height: 1.5;
  }

  .aria-input-container {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .aria-input-box {
    padding: 6px 6px 6px 16px;
    gap: 6px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .aria-input-field {
    font-size: 14px;
    padding: 10px 0;
  }

  .aria-input-field::placeholder {
    font-size: 13px;
  }

  .aria-mic-btn,
  .aria-send-btn {
    width: 36px;
    height: 36px;
  }

  .aria-caret {
    left: 16px;
    height: 18px;
  }

  .aria-suggestions {
    margin-top: 16px;
  }

  .aria-suggestion {
    padding: 7px 14px 7px 10px;
    font-size: 14px;
    gap: 6px;
    white-space: normal;
    align-items: flex-start;
  }

  .aria-suggestion .chip-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    margin-top: 3px;
  }

  .aria-messages {
    padding: 24px 20px;
    gap: 22px;
  }

  .aria-user-query {
    max-width: 85%;
  }

  .aria-response {
    max-width: 95%;
  }
}

/* Responsive — Short viewports */
@media (max-height: 720px) {
  .services-section {
    height: auto;
    min-height: auto;
    padding: 48px 0 64px;
  }

  .services-header {
    margin-bottom: 32px;
  }

  .aria-suggestions {
    margin-top: 14px;
    gap: 8px;
  }

  .aria-suggestion {
    padding: 7px 14px 7px 10px;
    font-size: 12px;
}
