/* ─── Keyframes ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}
@keyframes gridFade {
  from { opacity: 0; }
  to   { opacity: 0.5; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(239, 35, 56, 0.15), 0 0 60px rgba(239, 35, 56, 0.15); }
  50%      { box-shadow: 0 0 40px rgba(239, 35, 56, 0.25), 0 0 100px rgba(239, 35, 56, 0.25); }
}
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}
@keyframes messageAppear {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes orb1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(40px,-30px) scale(1.1); }
  66%      { transform: translate(-20px,20px) scale(0.95); }
}
@keyframes orb2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(-50px,20px) scale(0.9); }
  66%      { transform: translate(30px,-40px) scale(1.05); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

html {
  scroll-behavior: smooth;
}

/* ─── Animation utilities ─── */
.anim-fade-up { animation: fadeUp 0.7s ease both; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }
.anim-delay-6 { animation-delay: 0.6s; }

.float-card   { animation: floatY 4s ease-in-out infinite; }
.float-card-2 { animation: floatY 5s ease-in-out infinite; animation-delay: 1s; }

.fade-up { animation: fadeUp 0.8s ease forwards; }

/* ─── Scroll reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Grid background ─── */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridFade 1.5s ease forwards;
}

/* ─── Noise overlay ─── */
.noise::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
}

/* ─── Orb blobs ─── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.orb-red {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(239,35,56,0.18) 0%, transparent 50%);
  animation: orb1 12s ease-in-out infinite;
}
.orb-brand {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(44,46,72,0.4) 0%, transparent 70%);
  animation: orb2 15s ease-in-out infinite;
}

/* ─── Nav ─── */
.nav-blur {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(12,15,20,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ─── Glass card ─── */
.glass {
  background: rgba(20,24,32,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.07);
}
.glass-hover {
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.glass-hover:hover {
  border-color: rgba(239,35,56,0.35);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(239,35,56,0.08);
  transform: translateY(-4px);
}

/* ─── Badge ─── */
.badge {
  background: linear-gradient(135deg, rgba(239,35,56,0.15), rgba(239,35,56,0.05));
  border: 1px solid rgba(239,35,56,0.3);
  color: #ef2338;
}

/* ─── Gradient text ─── */
.text-gradient {
  background: linear-gradient(135deg, #ef2338 0%, #ff6b7a 60%, #ef2338 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ─── Buttons ─── */
.btn-accent {
  background: linear-gradient(135deg, #ef2338 0%, #c41c2e 100%);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 4px 24px rgba(239,35,56,0.3);
}
.btn-accent:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 40px rgba(239,35,56,0.5);
  filter: brightness(1.08);
}
.btn-accent:active  { transform: scale(0.98); }
.btn-accent:disabled {
  transform: none;
  box-shadow: none;
  filter: grayscale(100%) opacity(50%);
}

.btn-ghost {
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover {
  border-color: rgba(239,35,56,0.5);
  background: rgba(239,35,56,0.07);
}

/* ─── Testimonial avatar ─── */
.avatar-ring {
  box-shadow: 0 0 0 2px rgba(239,35,56,0.4);
}

/* ─── Chat mockup ─── */
.chat-msg { animation: messageAppear 0.4s ease both; }

.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.typing-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ef2338;
  animation: typingDot 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ─── Tool processing dot ─── */
.tool-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef2338;
  flex-shrink: 0;
  animation: pulse 1.2s ease-in-out infinite;
}

/* ─── Comparison table ─── */
.check-yes { color: #22c55e; }
.check-no  { color: #ef4444; }

/* ─── Pricing glow ─── */
.pricing-glow { animation: glowPulse 3s ease-in-out infinite; }

/* ─── FAQ accordion ─── */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), padding 0.3s;
}
.faq-content.open { max-height: 400px; }

.faq-icon { transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* ─── Markdown ─── */
.msg-bubble {
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.msg-bubble p {
  margin: 0 0 8px;
}
.msg-bubble p:last-child {
  margin: 0;
}
.msg-bubble ul,
.msg-bubble ol {
  padding-left: 18px;
  margin: 6px 0;
}
.msg-bubble hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 12px 0;
}
.msg-bubble strong {
  color: white;
}
.msg-bubble a {
  color: var(--color-accent);
  text-decoration: underline;
  word-break: break-all;
}
.msg-bubble code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--color-surface2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82rem;
}
.msg-bubble pre {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
  white-space: pre-wrap;
}
.msg-bubble pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
}

@media (max-width: 450px) {
  .msg-bubble ul,
  .msg-bubble ol {
    padding-left: 6px;
  }
}
