/* Voxtral Studio — polish au-delà de Tailwind (grain, scrollbar, transitions). */

:root {
  --accent: #d9531e;
  --accent-soft: #f0a273;
  --paper: #faf8f5;
  --ink: #1c1a17;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain fixe, hors flux, pour une matière chaude sans coût de repaint au scroll. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scrollbar discrète, teintée du fond. */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #d8d2c8;
  border-radius: 999px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover {
  background: #c7c0b3;
}

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

textarea {
  resize: vertical;
}

/* Flèche custom pour les <select> (suppression de l'apparence native). */
.select-field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%231c1a17' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}

/* Transitions fluides (MOTION_INTENSITY ~6). */
.tactile {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.tactile:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.fade-in {
  animation: fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Skeleton shimmer pour l'état de chargement. */
.shimmer {
  background: linear-gradient(
    100deg,
    #efe9e1 30%,
    #f7f2eb 50%,
    #efe9e1 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Point de statut « vivant ». */
.pulse-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.55;
  animation: pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(2.4);
    opacity: 0;
  }
}

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