/* ============================================================
   Atelier by Perry — Design tokens v3 + classes utilitaires
   Source: frontend/public/site/v3/theme.jsx (objet `t`)
   ============================================================ */

/* --- Tokens mode clair (défaut) --- */
:root {
  /* Couleurs de fond */
  --bg:        #fafaf7;
  --surface:   #ffffff;
  --surface2:  #f5f0ea;
  --surface3:  #ebe4d8;

  /* Séparateurs */
  --line:      rgba(26, 20, 16, 0.10);
  --line-soft: rgba(26, 20, 16, 0.05);

  /* Texte */
  --text:      #1a1410;
  --text-soft: rgba(26, 20, 16, 0.60);
  --text-mute: rgba(26, 20, 16, 0.35);

  /* Or */
  --gold:      #a8895d;
  --gold-soft: #c9a878;
  --gold-deep: #8a6d44;
  --gold-glow: rgba(168, 137, 93, 0.14);

  /* Bouton sur fond or */
  --btn-text:  #ffffff;

  /* Fond viewer 3D */
  --viewer:    radial-gradient(ellipse at 50% 40%, #fff 0%, #fafaf7 70%);

  /* Typographie */
  --font-serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-sans:  "Inter Tight", "Helvetica Neue", system-ui, sans-serif;
}

/* --- Tokens mode sombre --- */
[data-theme="dark"] {
  --bg:        #0b0b0d;
  --surface:   #131316;
  --surface2:  #1c1c20;
  --surface3:  #26262c;

  --line:      rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.04);

  --text:      #f1ece2;
  --text-soft: rgba(241, 236, 226, 0.78);
  --text-mute: rgba(241, 236, 226, 0.58);

  --gold:      #c9a878;
  --gold-soft: #d8bd92;
  --gold-deep: #a8895d;
  --gold-glow: rgba(201, 168, 120, 0.18);

  --btn-text:  #0b0b0d;

  --viewer:    radial-gradient(ellipse at 50% 40%, #1a1a1f 0%, #0b0b0d 70%);
}

/* ============================================================
   Reset de base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   Classes utilitaires .v3-*
   ============================================================ */

/* --- Boutons --- */
.v3-btn {
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.v3-btn:active {
  transform: scale(0.97);
}

.v3-btn-gold {
  background: var(--gold);
  color: var(--btn-text);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.v3-btn-gold:hover {
  background: var(--gold-soft);
}

.v3-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.v3-btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.v3-btn-text {
  background: transparent;
  color: var(--text-soft);
  border: none;
  padding: 0;
}

.v3-btn-text:hover {
  color: var(--gold);
}

/* --- Champs de formulaire --- */
.v3-input {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  padding: 14px 16px;
  width: 100%;
  font-size: 14px;
}

.v3-input:focus {
  border-color: var(--gold);
}

.v3-input::placeholder {
  color: var(--text-mute);
}

.v3-select {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 14px 36px 14px 16px;
  outline: none;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  /* Chevron SVG encodé — couleur fixe neutre, remplacée via JS si nécessaire */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path fill='rgba(26,20,16,0.35)' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

[data-theme="dark"] .v3-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path fill='rgba(241,236,226,0.58)' d='M0 0h10L5 6z'/></svg>");
}

.v3-select:focus {
  border-color: var(--gold);
}

/* --- Typographie --- */
.v3-cap {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}

.v3-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* --- Lien --- */
.v3-link {
  cursor: pointer;
  transition: color 0.15s;
}

.v3-link:hover {
  color: var(--gold);
}

/* --- Chip (sélecteur multi-choix) --- */
.v3-chip {
  padding: 10px 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.v3-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.v3-chip.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}

/* --- Radio visuel --- */
.v3-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.v3-radio.active {
  border-color: var(--gold);
  background: var(--gold);
}

.v3-radio.active::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg);
}

/* --- Animations --- */
.v3-fade {
  animation: v3-fade 0.4s ease both;
}

@keyframes v3-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.v3-bob {
  animation: v3-bob 4.2s ease-in-out infinite;
}

@keyframes v3-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%       { transform: translateY(-5px) rotate(-4deg); }
}

@keyframes v3-spin {
  to { transform: rotate(360deg); }
}

/* --- Focus visible a11y (WCAG 2.4.7) --- */
.v3-btn:focus-visible,
.v3-chip:focus-visible,
.v3-link:focus-visible,
.v3-input:focus-visible,
.v3-select:focus-visible,
.v3-radio:focus-visible,
article[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* --- Scrollbar fine (webkit) --- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 2px;
}
