/* Louie Concierge — signature motion surface
 * Animations: wordmark reveal, breathing gradient, card assembly, data-viz draws
 * Respects: prefers-reduced-motion
 */

/* ── Idle state ── */
.concierge-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: var(--space-8);
  padding: var(--space-8);
}

/* Wordmark reveal animation */
.wordmark-reveal {
  position: relative;
  width: 210px;
  height: 40px;
  opacity: 0;
}

.wordmark-reveal.reveal {
  animation: wordmarkReveal var(--dur-slow) var(--ease-out) forwards;
}

@keyframes wordmarkReveal {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

/* Breathing gradient (ambient) */
.breathing-gradient {
  position: absolute;
  inset: 0;
  background: var(--gradient-gold);
  opacity: 0.04;
  border-radius: 50%;
  filter: blur(40px);
  animation: breatheGradient 14s ease-in-out infinite alternate;
  z-index: -1;
  width: 180px;
  height: 180px;
  margin: auto;
}

@keyframes breatheGradient {
  from {
    opacity: 0.04;
    transform: scale(1);
  }
  to {
    opacity: 0.09;
    transform: scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark-reveal.reveal,
  .breathing-gradient {
    animation: none;
    opacity: 1;
  }
}

/* Starter chips */
.starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  max-width: 400px;
}

.chip {
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid var(--color-gold-text);
  color: var(--color-gold-text);
  padding: var(--space-2) var(--space-4);
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  font-family: var(--font-sans);
}

.chip:hover {
  background: rgba(201, 168, 76, 0.2);
  border-color: var(--color-gold);
}

.chip:active {
  transform: scale(0.96);
}

.chip:focus-visible {
  outline: 2px solid var(--color-gold-text);
  outline-offset: 2px;
}

/* ── Thinking state ── */
.concierge-thinking {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  min-height: 200px;
  padding: var(--space-8);
}

.pulse-orb {
  width: 60px;
  height: 60px;
  background: var(--color-gold);
  border-radius: 50%;
  animation: pulse var(--dur-slow) ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-orb {
    animation: none;
    opacity: 1;
  }
}

.status-line {
  font-size: var(--text-base);
  color: var(--color-ink-2);
  font-style: italic;
  min-height: 20px;
  text-align: center;
}

/* ── Intelligence Card (assembled) ── */
.intelligence-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-gold);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--dur-fast) var(--ease-out));
}

.intelligence-card:hover {
  box-shadow: var(--shadow-lg);
}

.intelligence-card:focus-within {
  outline: 2px solid var(--color-gold-text);
  outline-offset: 2px;
}

/* Staggered entry animation */
.intelligence-card {
  animation: cardSlideUp var(--dur-base) var(--ease-out) both;
  animation-delay: calc(var(--i) * var(--stagger));
}

@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intelligence-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.category-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-gold-text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  margin-bottom: var(--space-2);
}

.card-title {
  font-size: var(--text-lg);
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-4);
}

.data-region {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-4);
}

/* Score ring SVG */
.score-ring {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.score-circle {
  stroke-linecap: round;
  transform-origin: 50% 50%;
}

.score-label {
  font-family: var(--font-sans);
}

/* Sparkline SVG */
.sparkline {
  width: 100%;
  height: 50px;
  flex: 1;
}

.sparkline-path {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.supporting {
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  margin-top: var(--space-3);
}

/* ── Composer focus state ── */
.input-area:focus-within {
  border-top: 2px solid transparent;
  background: linear-gradient(var(--color-card), var(--color-card)) padding-box,
              var(--gradient-gold) border-box;
}

.input-area:focus-within #send-btn {
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
  animation: caretPulse var(--dur-base) var(--ease-spring) infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .input-area:focus-within #send-btn {
    animation: none;
    opacity: 1;
  }
}

/* FLIP send animation (message bubble continuous motion) */
.msg {
  animation: messageEntrance var(--dur-base) var(--ease-out) forwards;
}

@keyframes messageEntrance {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .msg {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Focus visibility for all interactive elements */
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--color-gold-text);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
  outline: none;
}
