:root {
  --background: 222 47% 97%;
  --foreground: 224 29% 14%;
  --primary: 257 84% 59%;
  --secondary: 188 70% 44%;
  --muted: 220 20% 92%;
  --destructive: 2 72% 56%;
  --border: 222 20% 84%;
  --card: 0 0% 100%;
  --shadow-sm: 0 8px 20px rgba(28, 25, 65, 0.08);
  --shadow-md: 0 16px 40px rgba(28, 25, 65, 0.12);
  --shadow-lg: 0 24px 60px rgba(28, 25, 65, 0.18);
  --transition-fast: 160ms ease;
  --transition-smooth: 320ms cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
}

.dark {
  --background: 230 24% 10%;
  --foreground: 220 20% 96%;
  --primary: 261 90% 70%;
  --secondary: 186 76% 62%;
  --muted: 227 18% 18%;
  --destructive: 4 79% 63%;
  --border: 228 14% 24%;
  --card: 228 18% 14%;
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, hsla(var(--primary), 0.16), transparent 28%),
    radial-gradient(circle at top right, hsla(var(--secondary), 0.14), transparent 24%),
    hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.card-surface {
  background: linear-gradient(180deg, hsla(var(--card), 0.98), hsla(var(--card), 0.94));
  border: 1px solid hsla(var(--border), 0.9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.glow-ring {
  position: relative;
}

.glow-ring::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, hsla(var(--primary), 0.35), hsla(var(--secondary), 0.24), transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.soft-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.soft-scroll::-webkit-scrollbar-thumb {
  background: hsla(var(--primary), 0.22);
  border-radius: 999px;
}

.soft-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.skeleton {
  background: linear-gradient(90deg, hsla(var(--muted), 0.7), hsla(var(--primary), 0.08), hsla(var(--muted), 0.7));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.float-in {
  animation: floatIn 500ms var(--transition-smooth);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pulse-dot {
  animation: pulseDot 1.6s infinite ease-in-out;
}

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

.hr-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: linear-gradient(135deg, hsla(var(--primary), 0.18), hsla(var(--secondary), 0.22));
  border: 1px solid hsla(var(--border), 0.9);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hr-avatar-speaking {
  animation: hrSpeak 1.2s infinite ease-in-out;
}

@keyframes hrSpeak {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 hsla(var(--primary), 0.24);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 16px hsla(var(--primary), 0);
  }
}

.hr-video-frame {
  position: relative;
  background:
    radial-gradient(circle at 30% 15%, hsla(var(--primary), 0.22), transparent 55%),
    radial-gradient(circle at 70% 30%, hsla(var(--secondary), 0.18), transparent 60%),
    linear-gradient(180deg, hsla(var(--card), 0.82), hsla(var(--background), 0.55));
  overflow: hidden;
}

.hr-video-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.2) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 5;
}

.hr-video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.3));
  pointer-events: none;
  z-index: 5;
}

.hr-video-speaking {
  animation: hrVideoPulse 900ms infinite ease-in-out;
}

@keyframes hrVideoPulse {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.15) brightness(1.05); }
}

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

.live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 10;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #ff4b4b;
  border-radius: 999px;
  box-shadow: 0 0 8px #ff4b4b;
  animation: livePulse 1s infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
}

.route-shell {
  min-height: calc(100vh - 80px);
}

video {
  border-radius: var(--radius-md);
  object-fit: cover;
}
