/**
 * PWA Install Styles
 * Bottom banner, iOS dialog, and hero download buttons
 * Uses the SalesCatalog design system variables
 */

/* ==================== BOTTOM INSTALL BANNER ==================== */
.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-component, #252526);
  border-top: 1px solid var(--border-default, #333);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 9998;
  padding: 12px 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.pwa-banner-visible {
  transform: translateY(0);
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  gap: 12px;
}

.pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md, 8px);
  flex-shrink: 0;
}

.pwa-banner-text {
  flex: 1;
  min-width: 0;
}

.pwa-banner-text strong {
  display: block;
  font-size: var(--text-base, 16px);
  color: var(--text-primary, #fff);
  font-weight: var(--font-semibold, 600);
}

.pwa-banner-text span {
  display: block;
  font-size: var(--text-sm, 14px);
  color: var(--text-secondary, #b3b3b3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-banner-install {
  background: var(--accent-primary, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: var(--radius-md, 8px);
  padding: 8px 20px;
  font-size: var(--text-sm, 14px);
  font-weight: var(--font-bold, 700);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
  font-family: inherit;
}

.pwa-banner-install:hover {
  background: var(--accent-secondary, #a78bfa);
}

.pwa-banner-dismiss {
  background: none;
  border: none;
  color: var(--text-tertiary, #8a8a8a);
  font-size: var(--text-sm, 14px);
  cursor: pointer;
  padding: 8px;
  font-family: inherit;
}

.pwa-banner-dismiss:hover {
  color: var(--text-secondary, #b3b3b3);
}

/* Light theme banner */
[data-theme="light"] .pwa-banner {
  background: #fff;
  border-top-color: #e5e7eb;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .pwa-banner-text strong {
  color: #111827;
}

[data-theme="light"] .pwa-banner-text span {
  color: #6b7280;
}

[data-theme="light"] .pwa-banner-dismiss {
  color: #9ca3af;
}


/* ==================== iOS ADD TO HOME SCREEN DIALOG ==================== */
.pwa-ios-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pwa-ios-overlay.pwa-ios-visible {
  opacity: 1;
}

.pwa-ios-overlay.pwa-ios-closing {
  opacity: 0;
}

.pwa-ios-dialog {
  background: var(--bg-component, #252526);
  border-radius: var(--radius-xl, 16px) var(--radius-xl, 16px) 0 0;
  width: 100%;
  max-width: 420px;
  padding: 24px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  position: relative;
}

.pwa-ios-visible .pwa-ios-dialog {
  transform: translateY(0);
}

.pwa-ios-closing .pwa-ios-dialog {
  transform: translateY(100%);
}

.pwa-ios-header {
  text-align: center;
  margin-bottom: 24px;
}

.pwa-ios-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg, 12px);
  margin: 0 auto 12px;
  display: block;
}

.pwa-ios-header h3 {
  color: var(--text-primary, #fff);
  font-size: var(--text-xl, 20px);
  font-weight: var(--font-bold, 700);
  margin: 0 0 4px;
}

.pwa-ios-header p {
  color: var(--text-secondary, #b3b3b3);
  font-size: var(--text-sm, 14px);
  margin: 0;
}

/* Steps */
.pwa-ios-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.pwa-ios-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pwa-ios-step-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full, 9999px);
  background: var(--accent-primary, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm, 14px);
  font-weight: var(--font-bold, 700);
  flex-shrink: 0;
}

.pwa-ios-step-content {
  flex: 1;
  padding-top: 4px;
}

.pwa-ios-step-title {
  color: var(--text-primary, #fff);
  font-size: var(--text-base, 16px);
  font-weight: var(--font-semibold, 600);
  margin-bottom: 2px;
}

.pwa-ios-step-desc {
  color: var(--text-secondary, #b3b3b3);
  font-size: var(--text-sm, 14px);
  line-height: 1.4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.pwa-ios-share-icon,
.pwa-ios-plus-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-primary, #8b5cf6);
  display: inline-block;
  vertical-align: middle;
}

/* Footer */
.pwa-ios-footer {
  text-align: center;
}

.pwa-ios-got-it {
  background: var(--accent-primary, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg, 12px);
  padding: 14px 48px;
  font-size: var(--text-base, 16px);
  font-weight: var(--font-bold, 700);
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
  font-family: inherit;
}

.pwa-ios-got-it:hover {
  background: var(--accent-secondary, #a78bfa);
}

/* Bottom arrow pointing to Safari share button */
.pwa-ios-arrow {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--bg-component, #252526);
  width: 32px;
  height: 32px;
}

/* Light theme iOS dialog */
[data-theme="light"] .pwa-ios-dialog {
  background: #fff;
}

[data-theme="light"] .pwa-ios-header h3 {
  color: #111827;
}

[data-theme="light"] .pwa-ios-header p {
  color: #6b7280;
}

[data-theme="light"] .pwa-ios-step-title {
  color: #111827;
}

[data-theme="light"] .pwa-ios-step-desc {
  color: #6b7280;
}

[data-theme="light"] .pwa-ios-arrow {
  color: #fff;
}


/* ==================== HERO DOWNLOAD BUTTONS ==================== */
.hero-download-section {
  margin-top: var(--space-xl, 48px);
  padding-top: var(--space-lg, 32px);
  border-top: 1px solid var(--border-subtle, #2c2c2c);
}

.hero-download-label {
  font-size: var(--text-sm, 14px);
  color: var(--text-tertiary, #8a8a8a);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md, 24px);
  text-align: center;
}

.hero-download-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Store-style download button */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  border-radius: var(--radius-lg, 12px);
  border: 1.5px solid var(--border-default, #333);
  background: var(--bg-component, #252526);
  color: var(--text-primary, #fff);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 181px;
  font-family: inherit;
}

.download-btn:hover {
  border-color: var(--accent-primary, #8b5cf6);
  background: var(--bg-elevated, #1a1a1a);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.download-btn-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.download-btn-icon svg {
  width: 100%;
  height: 100%;
}

.download-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.download-btn-label {
  font-size: 11px;
  color: var(--text-tertiary, #8a8a8a);
  line-height: 1.2;
}

.download-btn-title {
  font-size: var(--text-base, 16px);
  font-weight: var(--font-bold, 700);
  line-height: 1.3;
}

/* Light theme download buttons */
[data-theme="light"] .download-btn {
  background: #fff;
  border-color: #d1d5db;
  color: #111827;
}

[data-theme="light"] .download-btn:hover {
  border-color: var(--accent-primary, #8b5cf6);
  background: #f9fafb;
}

[data-theme="light"] .download-btn-label {
  color: #6b7280;
}

[data-theme="light"] .hero-download-label {
  color: #6b7280;
}

/* Responsive */
@media (max-width: 640px) {
  .hero-download-buttons {
    flex-direction: row;
    justify-content: center;
  }

  .pwa-banner-text span {
    font-size: 12px;
  }
  
  .pwa-banner-content {
    gap: 8px;
  }

  .pwa-banner-icon {
    width: 36px;
    height: 36px;
  }
}


/* ==================== HERO HEADING WITH ANIMATED GRADIENT + ICONS ==================== */
.hero-gradient-text {
  background: linear-gradient(90deg, #8b5cf6, #3b82f6, #8b5cf6, #a78bfa, #8b5cf6);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards, hero-gradient-flow 6s ease infinite;
}

@keyframes hero-gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Decorated words with attached icons via pseudo-elements */
/* position:relative breaks parent's background-clip:text paint layer,
   so each span replicates the gradient on itself */
.hero-word-catalogs,
.hero-word-brain {
  position: relative;
  display: inline;
  background: linear-gradient(90deg, #8b5cf6, #3b82f6, #8b5cf6, #a78bfa, #8b5cf6);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-gradient-flow 6s ease infinite;
}

/* Shopping bag icon — top-left of "Catalogs", rotated ~22deg */
.hero-word-catalogs::before {
  content: '';
  position: absolute;
  width: 0.45em;
  height: 0.45em;
  top: -0.15em;
  left: -0.12em;
  transform: rotate(-22deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.75;
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
  pointer-events: none;
}

/* Brain icon — top-right of "Brain", rotated ~12deg */
.hero-word-brain::after {
  content: '';
  position: absolute;
  width: 0.45em;
  height: 0.45em;
  right: 0em;
  transform: rotate(12deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 2a3 3 0 0 0-2.83 4H6a3 3 0 0 0 0 6h.17A3 3 0 0 0 9.5 16H10v6'/%3E%3Cpath d='M14.5 2a3 3 0 0 1 2.83 4H18a3 3 0 0 1 0 6h-.17A3 3 0 0 1 14.5 16H14v6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.75;
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
  pointer-events: none;
  margin-top: 0em;
}

/* Light theme — slight brightness boost */
[data-theme="light"] .hero-gradient-text {
  background: linear-gradient(90deg, #7c3aed, #2563eb, #7c3aed, #8b5cf6, #7c3aed);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeIn 0.8s ease forwards, hero-gradient-flow 6s ease infinite;
}

[data-theme="light"] .hero-word-catalogs,
[data-theme="light"] .hero-word-brain {
  background: linear-gradient(90deg, #7c3aed, #2563eb, #7c3aed, #8b5cf6, #7c3aed);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive icon sizing */
@media (max-width: 480px) {
  .hero-word-catalogs::before {
    width: 0.4em;
    height: 0.4em;
    top: -0.12em;
    left: -0.1em;
  }

  .hero-word-brain::after {
    width: 0.4em;
    height: 0.4em;
    right: -0.14em;
  }
}

/* ==================== CATALOG-TO-AI TRANSFORM PIPELINE ==================== */
/* Catalog product cards flow left→center into AI core, text emerges center→right */
/* All animations use transform + opacity only for GPU acceleration */
.hero-transform {
  --ht-travel: 155px;
  --ht-mid: 130px;
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 90px;
  margin: 0 auto var(--space-lg);
  pointer-events: none;
}

/* Product catalog cards */
.ht-card {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  left: 0;
  opacity: 0;
  will-change: transform, opacity;
  background-size: 15px 15px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Card 1 — T-shirt (clothing) */
.ht-c1 {
  top: 8%;
  background-color: rgba(139, 92, 246, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.38 3.46L16 2l-4 2-4-2L3.62 3.46 1 6v2h22V6z'/%3E%3Cpath d='M1 8v12a2 2 0 002 2h18a2 2 0 002-2V8'/%3E%3C/svg%3E");
  animation: ht-flow 10s 0s ease-in-out infinite;
}

/* Card 2 — Smartphone (electronics) */
.ht-c2 {
  top: 33%;
  background-color: rgba(59, 130, 246, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2'/%3E%3Cline x1='12' y1='18' x2='12.01' y2='18'/%3E%3C/svg%3E");
  animation: ht-flow 10s 2.5s ease-in-out infinite;
}

/* Card 3 — Shopping bag (retail) */
.ht-c3 {
  top: 58%;
  background-color: rgba(6, 182, 212, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E");
  animation: ht-flow 10s 5s ease-in-out infinite;
}

/* Card 4 — Coffee cup (food/beverage) */
.ht-c4 {
  top: 78%;
  background-color: rgba(167, 139, 250, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8h1a4 4 0 010 8h-1'/%3E%3Cpath d='M2 8h16v9a4 4 0 01-4 4H6a4 4 0 01-4-4V8z'/%3E%3C/svg%3E");
  animation: ht-flow 10s 7.5s ease-in-out infinite;
}

/* Card flow: slide from left edge → center, shrink and absorbed */
@keyframes ht-flow {
  0% {
    opacity: 0;
    transform: translateX(0) scale(0.6);
  }
  6% {
    opacity: 1;
    transform: translateX(15px) scale(1);
  }
  18% {
    opacity: 0.9;
    transform: translateX(var(--ht-mid)) scale(0.85);
  }
  24% {
    opacity: 0;
    transform: translateX(var(--ht-travel)) scale(0.15);
  }
  25%, 100% {
    opacity: 0;
    transform: translateX(var(--ht-travel)) scale(0);
  }
}

/* Central AI Processing Core */
.ht-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.06);
  z-index: 2;
}

/* Brain icon inside the core */
.ht-core::before {
  content: '';
  position: absolute;
  inset: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 2a3 3 0 00-2.83 4H6a3 3 0 000 6h.17A3 3 0 009.5 16H10v6'/%3E%3Cpath d='M14.5 2a3 3 0 012.83 4H18a3 3 0 010 6h-.17A3 3 0 0114.5 16H14v6'/%3E%3C/svg%3E");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* Pulsing glow around the AI core */
.ht-core::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent 70%);
  animation: ht-pulse 3s ease-in-out infinite;
}

@keyframes ht-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* Chat bubble outputs — emerge from center, clearly recognizable as chat messages */
.ht-text {
  position: absolute;
  left: calc(50% + 28px);
  padding: 5px 10px;
  border-radius: 10px 10px 10px 3px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(139, 92, 246, 0.06);
  opacity: 0;
  will-change: transform, opacity;
  white-space: nowrap;
}

/* Chat bubble tail pointing toward AI core */
.ht-text::after {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-right-color: rgba(139, 92, 246, 0.2);
  border-left: 0;
}

/* Visible micro-text content inside each bubble */
.ht-text::before {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-secondary, #a1a1aa);
  letter-spacing: 0.01em;
}

.ht-t1 {
  top: 5%;
  animation: ht-emerge 10s 1.2s ease-out infinite;
}
.ht-t1::before { content: "Browse 200+ items instantly"; }

.ht-t2 {
  top: 38%;
  animation: ht-emerge 10s 3.7s ease-out infinite;
}
.ht-t2::before { content: "Book a service anytime"; }

.ht-t3 {
  top: 68%;
  animation: ht-emerge 10s 6.2s ease-out infinite;
}
.ht-t3::before { content: "AI chat on your website"; }

/* Chat bubble emerge: slide in from center, stay, then fade out */
@keyframes ht-emerge {
  0%, 10% {
    opacity: 0;
    transform: translateX(-8px) scale(0.85);
  }
  18% {
    opacity: 0.9;
    transform: translateX(0) scale(1);
  }
  24% {
    opacity: 0.7;
    transform: translateX(4px);
  }
  30% {
    opacity: 0;
    transform: translateX(10px) scale(0.9);
  }
  31%, 100% {
    opacity: 0;
  }
}

/* Light theme: brighter card borders and text lines */
[data-theme="light"] .ht-card {
  border-color: rgba(124, 58, 237, 0.3);
}

[data-theme="light"] .ht-core {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .ht-text {
  border-color: rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .ht-text::after {
  border-right-color: rgba(124, 58, 237, 0.25);
}

/* Widescreen: bigger pipeline */
@media (min-width: 1200px) {
  .hero-transform {
    --ht-travel: 190px;
    --ht-mid: 160px;
    max-width: 460px;
    height: 110px;
  }

  .ht-card {
    width: 32px;
    height: 32px;
    background-size: 17px 17px;
  }

  .ht-core {
    width: 52px;
    height: 52px;
  }

  .ht-core::before {
    inset: 10px;
  }

  .ht-text {
    left: calc(50% + 38px);
    padding: 6px 12px;
  }

  .ht-text::before {
    font-size: 10px;
  }
}

/* Mobile: compact pipeline */
@media (max-width: 480px) {
  .hero-transform {
    --ht-travel: 108px;
    --ht-mid: 90px;
    max-width: 260px;
    height: 65px;
  }

  .ht-card {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background-size: 12px 12px;
  }

  .ht-core {
    width: 36px;
    height: 36px;
  }

  .ht-core::before {
    inset: 6px;
  }

  .ht-core::after {
    inset: -8px;
  }

  .ht-text {
    left: calc(50% + 22px);
    padding: 3px 7px;
  }

  .ht-text::before {
    font-size: 7px;
  }
}

/* ==================== HERO AI CONVERSATION ANIMATION ==================== */
.hero-illustration {
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.hero-convo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  width: 100%;
  min-height: 160px;
  position: relative;
}

/* Message columns */
.hero-convo-left,
.hero-convo-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.hero-convo-right {
  align-items: flex-end;
}

.hero-convo-left {
  align-items: flex-start;
}

/* Center AI Core */
.hero-convo-center {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-ai-core {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-ai-icon {
  color: var(--accent-primary, #8b5cf6);
  z-index: 2;
  animation: hero-ai-pulse 3s ease-in-out infinite;
}

.hero-ai-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--accent-primary, #8b5cf6);
}

.hero-ai-ring-outer {
  width: 56px;
  height: 56px;
  opacity: 0.2;
  animation: hero-ring-spin 8s linear infinite;
  border-style: dashed;
}

.hero-ai-ring-inner {
  width: 40px;
  height: 40px;
  opacity: 0.35;
  animation: hero-ring-spin 6s linear infinite reverse;
  border-style: dotted;
}

@keyframes hero-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes hero-ai-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Energy particles */
.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-primary, #8b5cf6);
  opacity: 0;
}

.hero-particle-1 {
  animation: hero-particle-flow 9s 0.5s ease-in-out infinite;
}
.hero-particle-2 {
  animation: hero-particle-flow 9s 3.5s ease-in-out infinite;
}
.hero-particle-3 {
  animation: hero-particle-flow 9s 6.5s ease-in-out infinite;
}

@keyframes hero-particle-flow {
  0% { left: -20px; top: 50%; opacity: 0; transform: scale(0.5); }
  10% { opacity: 0.8; transform: scale(1); }
  45% { left: 30px; top: 50%; opacity: 0.6; }
  55% { left: 34px; top: 50%; opacity: 0.6; }
  90% { opacity: 0.8; transform: scale(1); }
  100% { left: 84px; top: 50%; opacity: 0; transform: scale(0.5); }
}

/* Message rows */
.hero-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
}

/* Avatar circles */
.hero-msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-msg-avatar svg {
  width: 13px;
  height: 13px;
}

.hero-msg-avatar-user {
  background: var(--accent-secondary, #a78bfa);
  color: #fff;
}

.hero-msg-avatar-ai {
  background: var(--accent-primary, #8b5cf6);
  color: #fff;
}

/* Chat bubbles */
.hero-msg-bubble {
  padding: 6px 10px;
  border-radius: 12px;
  max-width: 140px;
}

.hero-msg-bubble-user {
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-bottom-left-radius: 4px;
}

.hero-msg-bubble-ai {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-bottom-right-radius: 4px;
}

.hero-msg-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #a1a1aa);
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  width: 0;
}

/* Staggered typing animation: each message pair cycles in a 9s loop */
/* Question 1 types in, then Answer 1 types in, then both fade out */
.hero-msg-1 {
  animation: hero-msg-appear 9s 0s ease infinite;
}
.hero-msg-1 .hero-msg-text {
  animation: hero-typewriter-q1 9s 0s steps(17) infinite;
}

.hero-msg-4 {
  animation: hero-msg-appear-answer 9s 0s ease infinite;
}
.hero-msg-4 .hero-msg-text {
  animation: hero-typewriter-a1 9s 0s steps(18) infinite;
}

/* Question 2 + Answer 2 */
.hero-msg-2 {
  animation: hero-msg-appear 9s 3s ease infinite;
}
.hero-msg-2 .hero-msg-text {
  animation: hero-typewriter-q2 9s 3s steps(18) infinite;
}

.hero-msg-5 {
  animation: hero-msg-appear-answer 9s 3s ease infinite;
}
.hero-msg-5 .hero-msg-text {
  animation: hero-typewriter-a2 9s 3s steps(14) infinite;
}

/* Question 3 + Answer 3 */
.hero-msg-3 {
  animation: hero-msg-appear 9s 6s ease infinite;
}
.hero-msg-3 .hero-msg-text {
  animation: hero-typewriter-q3 9s 6s steps(16) infinite;
}

.hero-msg-6 {
  animation: hero-msg-appear-answer 9s 6s ease infinite;
}
.hero-msg-6 .hero-msg-text {
  animation: hero-typewriter-a3 9s 6s steps(16) infinite;
}

/* Message container appear/disappear */
@keyframes hero-msg-appear {
  0% { opacity: 0; transform: translateX(-8px); }
  5% { opacity: 1; transform: translateX(0); }
  28% { opacity: 1; }
  33% { opacity: 0; transform: translateX(0); }
  100% { opacity: 0; }
}

@keyframes hero-msg-appear-answer {
  0%, 12% { opacity: 0; transform: translateX(8px); }
  17% { opacity: 1; transform: translateX(0); }
  28% { opacity: 1; }
  33% { opacity: 0; transform: translateX(0); }
  100% { opacity: 0; }
}

/* Typewriter: text width goes from 0 to full */
/* "What do you sell?" = 17 chars → ~97px */
@keyframes hero-typewriter-q1 {
  0%, 1% { width: 0; }
  10% { width: 97px; }
  28% { width: 97px; }
  33%, 100% { width: 0; }
}

/* "Over 50 products!" = 18 chars → ~100px */
@keyframes hero-typewriter-a1 {
  0%, 13% { width: 0; }
  22% { width: 100px; }
  28% { width: 100px; }
  33%, 100% { width: 0; }
}

/* "What's the price?" = 18 chars → ~100px */
@keyframes hero-typewriter-q2 {
  0%, 1% { width: 0; }
  10% { width: 100px; }
  28% { width: 100px; }
  33%, 100% { width: 0; }
}

/* "Starting at $10" = 14 chars → ~84px */
@keyframes hero-typewriter-a2 {
  0%, 13% { width: 0; }
  22% { width: 84px; }
  28% { width: 84px; }
  33%, 100% { width: 0; }
}

/* "Do you deliver?" = 16 chars → ~92px */
@keyframes hero-typewriter-q3 {
  0%, 1% { width: 0; }
  10% { width: 92px; }
  28% { width: 92px; }
  33%, 100% { width: 0; }
}

/* "Yes, nationwide!" = 16 chars → ~92px */
@keyframes hero-typewriter-a3 {
  0%, 13% { width: 0; }
  22% { width: 92px; }
  28% { width: 92px; }
  33%, 100% { width: 0; }
}

/* Light theme adjustments */
[data-theme="light"] .hero-msg-bubble-user {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.2);
}

[data-theme="light"] .hero-msg-bubble-ai {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
}

/* Responsive */
@media (max-width: 480px) {
  .hero-convo-container {
    gap: 8px;
    min-height: 130px;
  }

  .hero-convo-center {
    width: 48px;
    height: 48px;
  }

  .hero-ai-core {
    width: 42px;
    height: 42px;
  }

  .hero-ai-ring-outer {
    width: 42px;
    height: 42px;
  }

  .hero-ai-ring-inner {
    width: 30px;
    height: 30px;
  }

  .hero-ai-icon svg {
    width: 24px;
    height: 24px;
  }

  .hero-msg-bubble {
    padding: 5px 8px;
    max-width: 110px;
  }

  .hero-msg-text {
    font-size: 10px;
  }

  .hero-msg-avatar {
    width: 18px;
    height: 18px;
  }

  .hero-msg-avatar svg {
    width: 11px;
    height: 11px;
  }
}
