/* ═══════════════════════════════════════════════
   ArtizBoard — Theme Engine v2
   10 themes × 3 modes (light/dark/sharp)
   Design tokens + animations + CTA + responsive
   ═══════════════════════════════════════════════ */

/* === THEME CSS VARIABLES (injected by theme.js) === */
:root {
  --theme-primary: #D4A14C;
  --theme-primary-light: #E8C97A;
  --theme-primary-dark: #8B6914;
  --theme-surface: #FEFDF9;
  --theme-surface-alt: #F8F4EC;
  --theme-background: #FEFDF9;
  --theme-text-strong: #1C1914;
  --theme-text-soft: #5C5548;
  --theme-text-on-primary: #1a1a1a;
  --theme-accent: #C44536;
  --theme-outline: #E0D8C8;
  --theme-radius: 12px;
  --theme-radius-sm: 8px;
  --theme-radius-lg: 16px;
  --theme-shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --theme-shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --theme-shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --theme-font-heading: 'Inter', system-ui, sans-serif;
  --theme-font-body: 'Inter', system-ui, sans-serif;
  --theme-anim-speed: 0.3s;
  --theme-accent-rgb: 196,69,54;
}

/* === SHARP MODE === */
body.theme-sharp {
  --theme-radius: 2px;
  --theme-radius-sm: 1px;
  --theme-radius-lg: 2px;
  --theme-shadow-sm: none;
  --theme-shadow-md: none;
  --theme-shadow-lg: none;
}
body.theme-sharp *,
body.theme-sharp *::before,
body.theme-sharp *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

/* === DARK MODE OVERRIDES === */
body.theme-dark {
  --theme-primary: #E8C97A;
  --theme-primary-light: #F0D89E;
  --theme-primary-dark: #B8962E;
  --theme-surface: #1C1914;
  --theme-surface-alt: #2A2418;
  --theme-background: #141210;
  --theme-text-strong: #F5F0E8;
  --theme-text-soft: #A09888;
  --theme-text-on-primary: #1C1914;
  --theme-accent: #E0735D;
  --theme-outline: #3D3424;
  --theme-shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --theme-shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --theme-shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

/* === RESPONSIVE BREAKPOINTS === */
:root {
  --bp-mobile: 700px;
  --bp-tablet: 1024px;
  --container-max: 1100px;
}

/* === TYPOGRAPHY SYSTEM === */
:root {
  --fs-hero: clamp(2rem, 5vw, 4rem);
  --fs-display: clamp(1.5rem, 3vw, 2.25rem);
  --fs-headline: clamp(1.25rem, 2vw, 1.75rem);
  --fs-title: clamp(1rem, 1.5vw, 1.25rem);
  --fs-body: clamp(0.875rem, 1.2vw, 1rem);
  --fs-label: clamp(0.75rem, 1vw, 0.875rem);
  --fs-small: 0.75rem;
}

body {
  background: var(--theme-background);
  color: var(--theme-text-strong);
  font-family: var(--theme-font-body);
  transition: background var(--theme-anim-speed), color var(--theme-anim-speed);
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--theme-accent-rgb), 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(var(--theme-accent-rgb), 0); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.anim-fade-up { animation: fadeUp 0.6s cubic-bezier(0.4,0,0.2,1) both; }
.anim-scale-in { animation: scaleIn 0.4s cubic-bezier(0.4,0,0.2,1) both; }
.anim-slide-right { animation: slideRight 0.5s cubic-bezier(0.4,0,0.2,1) both; }

/* === REVEAL ON SCROLL === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1),
              transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* === PREFERS REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* === BADGES (URGENCE / PROMO) === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 700;
  white-space: nowrap;
}
.badge-urgence {
  background: var(--theme-accent);
  color: white;
  animation: pulse 2.5s infinite;
}
.badge-promo {
  background: var(--theme-primary);
  color: var(--theme-text-on-primary);
}
.badge-new {
  background: var(--theme-text-strong);
  color: var(--theme-background);
}
.badge-best {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  color: white;
}

/* === CTA BAR (fixed bottom) === */
.cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--theme-surface);
  border-top: 1px solid var(--theme-outline);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  animation: fadeUp 0.4s ease both;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.cta-bar .cta-text {
  flex: 1;
  font-size: var(--fs-label);
  color: var(--theme-text-soft);
}
.cta-bar .cta-text strong {
  color: var(--theme-text-strong);
  display: block;
  font-size: var(--fs-body);
}
.cta-bar .cta-btn {
  flex-shrink: 0;
}

/* === TESTIMONIALS === */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}
.testimonial-card {
  background: var(--theme-surface);
  border: 1px solid var(--theme-outline);
  border-radius: var(--theme-radius);
  padding: var(--space-lg);
  transition: transform var(--theme-anim-speed), box-shadow var(--theme-anim-speed);
}
.testimonial-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--theme-shadow-md);
}
.testimonial-card .stars {
  color: var(--theme-primary);
  font-size: var(--fs-body);
  margin-bottom: var(--space-xs);
}
.testimonial-card .quote {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--theme-text-soft);
  font-style: italic;
  margin-bottom: var(--space-md);
}
.testimonial-card .author {
  font-weight: 700;
  font-size: var(--fs-label);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.testimonial-card .author img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* === SKELETON LOADING === */
.skeleton {
  background: linear-gradient(90deg,
    var(--theme-surface-alt) 25%,
    var(--theme-outline) 50%,
    var(--theme-surface-alt) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--theme-radius-sm);
}
.skeleton-text { height: 1em; margin-bottom: 0.5em; }
.skeleton-text:last-child { width: 60%; }
.skeleton-img { width: 100%; height: 200px; }
.skeleton-title { height: 1.5em; width: 80%; margin-bottom: 1em; }

/* === THEME TOGGLE (sun/moon) === */
.theme-toggle {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--theme-outline);
  background: var(--theme-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 160;
  box-shadow: var(--theme-shadow-sm);
  transition: all var(--theme-anim-speed);
}
.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--theme-shadow-md);
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
  .testimonial-grid { grid-template-columns: 1fr; }
  .cta-bar { flex-direction: column; text-align: center; padding: var(--space-sm) var(--space-md); }
  .cta-bar .cta-btn { width: 100%; }
  .hero-title { font-size: 2rem; }
}

@media (min-width: 701px) and (max-width: 1024px) {
  .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
}
