/* antsamath — design tokens & composants partagés (Theme A : Playground)
   Mode clair par défaut + mode sombre via html[data-theme="dark"]. */

:root {
  --bg: #FBF7EE;
  --bg-2: #F3ECDD;
  --ink: #1B1A22;
  --ink-soft: #5C5867;
  --line: #E4DBC9;
  --card: #FFFFFF;
  --thumb-base: #FFFFFF;
  --accent: #FF6B3D;
  --shadow: rgba(40, 28, 14, .14);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --body: "Lexend", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Space Mono", "Cascadia Code", "Menlo", "Consolas", ui-monospace, monospace;
  --r: 22px;
}
html[data-theme="dark"] {
  --bg: #15131B;
  --bg-2: #1F1C27;
  --ink: #F3EFE7;
  --ink-soft: #A7A0B2;
  --line: #302B3A;
  --card: #1E1B26;
  --thumb-base: #141019;
  --accent: #FF7A4D;
  --shadow: rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 14px clamp(16px, 5vw, 64px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; position: relative; flex: none; }
.brand-mark .orbit { position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: 50%; }
.brand-mark .sun { position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--accent); }
.brand-mark .moon { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #2E8BFF; transform-origin: -7px center; animation: orbit 4.5s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.brand b { color: var(--accent); }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a.txtlink { font-family: var(--body); font-size: 14.5px; color: var(--ink-soft); padding: 8px 12px; border-radius: 10px; transition: color .2s, background .2s; }
.nav-links a.txtlink:hover { color: var(--ink); background: var(--bg-2); }

/* toggles : langue + thème */
.langbtn, .themebtn {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  height: 38px; padding: 0 12px; border-radius: 999px; cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.themebtn { width: 38px; padding: 0; }
.themebtn svg { width: 17px; height: 17px; display: block; }
.langbtn:hover, .themebtn:hover { background: var(--ink); color: var(--bg); }
.gh { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink); transition: all .2s; }
.gh:hover { border-color: var(--ink); transform: rotate(-8deg); }
.gh svg { width: 18px; height: 18px; }

/* ---------- BOUTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 16px;
  padding: 14px 24px; border-radius: 999px; cursor: pointer; border: 0;
  transition: transform .15s, box-shadow .2s; text-align: left;
}
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: 0 8px 0 0 color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 0 0 color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 0 color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- CHIPS / FILTRES ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-soft);
  transition: all .18s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- CARTE D'ARTEFACT ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.9,.3,1.2), box-shadow .22s, border-color .22s;
  position: relative; opacity: 1; animation: cardIn .5s both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; opacity: 1; transform: none; } }
.card.is-hidden { display: none; }
.card:hover { transform: translateY(-7px); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: 0 18px 38px -16px color-mix(in srgb, var(--c) 60%, transparent); }
.thumb {
  position: relative; aspect-ratio: 16 / 9;
  background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--c) 16%, var(--thumb-base)) 0%, color-mix(in srgb, var(--c) 6%, var(--thumb-base)) 70%);
  border-bottom: 1px solid color-mix(in srgb, var(--c) 18%, var(--line));
  transition: background .25s;
}
.card:hover .thumb { background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--c) 26%, var(--thumb-base)) 0%, color-mix(in srgb, var(--c) 10%, var(--thumb-base)) 70%); }
.thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb .num { position: absolute; top: 10px; right: 12px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--c) 75%, var(--ink)); opacity: .7; }
.thumb .badge-new { position: absolute; top: 10px; left: 12px; font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--c); padding: 3px 8px; border-radius: 999px; }
.cbody { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.ctop { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.formula { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--thumb-base)); padding: 4px 9px; border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.level { font-size: 10px; letter-spacing: 1px; color: var(--c); }
.ctitle { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; margin: 0 0 7px; }
.cdesc { font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 16px; font-weight: 300; flex: 1; }
.copen { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--ink); }
.copen .arr { transition: transform .2s; color: var(--c); }
.card:hover .copen .arr { transform: translateX(5px); }
.card .visits { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 13px; font-weight: 700;
  padding: 13px 20px; border-radius: 999px; z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; box-shadow: 0 14px 30px -10px rgba(0,0,0,.4); max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- FOOTER ---------- */
footer { padding: 48px clamp(16px, 5vw, 64px) 56px; border-top: 1px dashed var(--line); margin-top: 30px; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.foot-inner .fnote { font-size: 13.5px; color: var(--ink-soft); }
.foot-inner .fnote b { color: var(--accent); }
.foot-links { display: flex; gap: 16px; font-family: var(--mono); font-size: 13px; }
.foot-links a:hover { color: var(--accent); }
.swatches { display: flex; gap: 6px; }
.swatches i { width: 14px; height: 14px; border-radius: 4px; display: block; }

@media (max-width: 680px) {
  .nav-links a.txtlink { display: none; }
  .nav { gap: 10px; padding: 12px 16px; }
  .brand { font-size: 18px; }
  .nav-links { gap: 5px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .feedback-wrap { grid-template-columns: 1fr; }
  /* touch targets minimum 44px */
  .langbtn, .themebtn, .gh { min-height: 44px; }
  .chip { min-height: 44px; padding: 11px 16px; }
  .btn { padding: 14px 22px; font-size: 15px; }
  .cta-row { gap: 12px; }
  footer { padding: 36px 16px 48px; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: clamp(32px, 9vw, 52px); }
  .hero p.lede { font-size: 15px; }
  main { padding: clamp(28px, 5vw, 48px) 14px 16px; }
  .sec-head h2 { font-size: clamp(20px, 6vw, 30px); }
  /* grille à 2 colonnes sur téléphone large, 1 colonne sur petit */
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
}
@media (max-width: 420px) {
  .langbtn, .themebtn, .gh { height: 40px; }
  .themebtn, .gh { width: 40px; }
  .nav { padding: 10px 14px; }
  .brand { font-size: 17px; }
}
