/**
 * QuoteNest Design Tokens
 * CallRail-inspired premium design system
 */

:root {
  /* Colors - Premium palette */
  --color-ink: #0f172a;
  --color-mist: #f8fafc;
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-900: #0f172a;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #eff6ff;
  --color-rose-500: #f43f5e;
  --color-orange-500: #f97316;
  --color-amber-500: #f59e0b;
  --color-emerald-500: #10b981;

  /* Typography */
  --font-display: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --text-hero: clamp(2.25rem, 5vw, 3.5rem);
  --text-section: clamp(1.5rem, 3vw, 2.25rem);
  --line-tight: 1.2;
  --line-snug: 1.375;

  /* Spacing */
  --section-padding: clamp(3rem, 8vw, 6rem);
  --card-padding: 1.5rem;

  /* Radius */
  --radius-card: 1.25rem;
  --radius-button: 0.75rem;
  --radius-badge: 9999px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 20px 50px -15px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px -10px rgba(37, 99, 235, 0.3);
}

/* Font import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Scroll reveal */
.qn-reveal {
  /* Disable reveal/loading motion site-wide: show content immediately */
  opacity: 1;
  transform: none;
  transition: none;
}
.qn-revealed {
  opacity: 1;
  transform: none;
}

/* Urgency badges */
.qn-urgency-emergency { background: #fef2f2; color: #b91c1c; }
.qn-urgency-high { background: #fff7ed; color: #c2410c; }
.qn-urgency-medium { background: #fffbeb; color: #b45309; }
.qn-urgency-low { background: #ecfdf5; color: #047857; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Inline SVG from PHP readfile (homepage lead illustration) */
.qn-lead-illustration-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1rem;
  vertical-align: top;
}

/* Homepage: compact premium phone + lead notifications */
.qn-lead-hero-wrap {
  position: relative;
  width: 100%;
  max-width: 25rem;
  height: min(72vw + 9.5rem, 20rem);
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
}

@media (min-width: 480px) {
  .qn-lead-hero-wrap {
    height: min(68vw + 8rem, 21rem);
    max-width: 26rem;
  }
}

@media (min-width: 1024px) {
  .qn-lead-hero-wrap {
    margin-left: 0;
    margin-right: auto;
    height: 22rem;
    max-width: 27.5rem;
  }
}

@media (min-width: 1280px) {
  .qn-lead-hero-wrap {
    height: 23rem;
    max-width: 28.5rem;
  }
}

.qn-lead-hero-glow {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 40%;
  width: min(72vw, 15rem);
  height: min(72vw, 15rem);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, transparent 70%);
  filter: blur(2px);
}

@media (min-width: 1024px) {
  .qn-lead-hero-glow {
    left: 8.75rem;
    top: 50%;
    width: 17.5rem;
    height: 17.5rem;
    transform: translate(-50%, -50%);
  }
}

@media (min-width: 1280px) {
  .qn-lead-hero-glow {
    left: 9.25rem;
    width: 18.5rem;
    height: 18.5rem;
  }
}

.qn-lead-hero-circle {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 0.65rem;
  aspect-ratio: 1;
  width: min(74vw, 13.75rem);
  overflow: hidden;
  border-radius: 50%;
  border: 3px solid #2563eb;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.98),
    0 16px 36px -12px rgba(15, 23, 42, 0.2);
  transform: translateX(-50%);
}

@media (min-width: 640px) {
  .qn-lead-hero-circle {
    width: min(78vw, 15.75rem);
    top: 50%;
    transform: translate(-50%, -50%);
  }
}

@media (min-width: 1024px) {
  .qn-lead-hero-circle {
    left: 0;
    width: 16.75rem;
    transform: translateY(-50%);
    top: 50%;
  }
}

@media (min-width: 1280px) {
  .qn-lead-hero-circle {
    width: 17.75rem;
  }
}

.qn-lead-hero-stack {
  position: absolute;
  z-index: 14;
  left: 50%;
  top: 1.35rem;
  display: flex;
  width: min(calc(100vw - 2rem), 13.25rem);
  flex-direction: column;
  gap: 0.32rem;
  transform: translateX(calc(-50% + min(17vw, 3.85rem)));
}

@media (min-width: 480px) {
  .qn-lead-hero-stack {
    width: min(13.75rem, calc(100% - 1rem));
    transform: translateX(calc(-50% + min(20vw, 5rem)));
  }
}

@media (min-width: 640px) {
  .qn-lead-hero-stack {
    left: auto;
    right: 0;
    top: 1.1rem;
    transform: none;
    width: 14rem;
  }
}

@media (min-width: 1024px) {
  .qn-lead-hero-stack {
    right: 0;
    top: 0.85rem;
    width: 14.125rem;
  }
}

@media (min-width: 1280px) {
  .qn-lead-hero-stack {
    width: 14.5rem;
    top: 0.75rem;
  }
}

.qn-lead-hero-wave {
  display: flex;
  height: 1.2rem;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 0 0.125rem;
}

.qn-lead-hero-wave span {
  width: 2px;
  border-radius: 9999px;
  background: linear-gradient(to top, #6366f1, #3b82f6);
  animation: qn-lead-hero-wave 1.15s ease-in-out infinite;
}

.qn-lead-hero-wave span:nth-child(2) {
  animation-delay: 0.08s;
}
.qn-lead-hero-wave span:nth-child(3) {
  animation-delay: 0.16s;
}
.qn-lead-hero-wave span:nth-child(4) {
  animation-delay: 0.24s;
}
.qn-lead-hero-wave span:nth-child(5) {
  animation-delay: 0.32s;
}
.qn-lead-hero-wave span:nth-child(6) {
  animation-delay: 0.4s;
}
.qn-lead-hero-wave span:nth-child(7) {
  animation-delay: 0.48s;
}
.qn-lead-hero-wave span:nth-child(8) {
  animation-delay: 0.56s;
}

@keyframes qn-lead-hero-wave {
  0%,
  100% {
    height: 22%;
    opacity: 0.75;
  }
  50% {
    height: 100%;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qn-lead-hero-wave span {
    animation: none !important;
    height: 55% !important;
    opacity: 1 !important;
  }
}

/* Voice Assist: animated thread from QN pill to transcript card (lg+, JS positions path) */
.qn-voice-assist-thread-root {
  position: relative;
  isolation: isolate;
}

.qn-voice-assist-thread-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10; /* above background, below the hero circle/stack */
  overflow: visible;
}

.qn-voice-assist-thread-track {
  stroke: rgba(37, 99, 235, 0.14);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qn-voice-assist-thread-path {
  stroke: url(#qn-voice-assist-thread-grad);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: 0.92;
}

@keyframes qn-voice-assist-thread-dash {
  to {
    stroke-dashoffset: -130;
  }
}

@media (max-width: 1023.98px) {
  .qn-voice-assist-thread-track {
    stroke-width: 3;
  }

  .qn-voice-assist-thread-path {
    stroke-width: 1.9;
    opacity: 0.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qn-voice-assist-thread-path {
    animation: none !important;
  }
}

/* Voice Assist: tighten the hero circle/stack proportions on small screens */
@media (max-width: 639.98px) {
  .qn-lead-hero-wrap {
    /* Use the same proportions as the desktop-ish layout so the hero pills
       don't sit on top of the circle image on very small screens. */
    height: min(72vw + 9.5rem, 20rem);
    max-width: 23rem;
  }

  .qn-lead-hero-circle {
    left: 27%;
    top: 2rem;
    width: min(74vw, 13.75rem);
    border-width: 3px;
    /* Lift the photo off the slate background on small screens */
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.98),
      0 22px 48px -14px rgba(15, 23, 42, 0.32),
      0 6px 18px -8px rgba(37, 99, 235, 0.18);
  }

  .qn-lead-hero-stack {
    top: 1.05rem;
    width: min(calc(100% - 1.4rem), 11.9rem);
    /* Push further right on small screens so more of the face remains visible. */
    transform: translateX(calc(-50% + min(19vw, 4.8rem)));
  }

  .qn-lead-hero-wave {
    height: 1.2rem;
  }
}
