/* ===========================
   MesMarChands — Hi-Fi tokens
   Direction B · split client/marchand
   =========================== */

:root {
  /* Surfaces */
  --bg: #fafaf7;
  --bg-elev: #ffffff;
  --bg-sunken: #f4f3ee;
  --bg-dark: #0e0e0c;
  --bg-dark-elev: #18181a;

  /* Ink */
  --ink: #0a0a0a;
  --ink-2: #2a2a28;
  --ink-3: #5a5a55;
  --ink-4: #8a8a82;
  --ink-on-dark: #f5f4ee;
  --ink-on-dark-2: #b6b4a8;
  --ink-on-dark-3: #707068;

  /* Accent — vermillon chaud */
  --accent: oklch(0.62 0.18 30);
  --accent-soft: oklch(0.62 0.18 30 / 0.10);
  --accent-line: oklch(0.62 0.18 30 / 0.25);
  --accent-deep: oklch(0.45 0.16 30);

  /* Borders */
  --border: rgba(10, 10, 10, 0.08);
  --border-strong: rgba(10, 10, 10, 0.14);
  --border-on-dark: rgba(255, 255, 255, 0.08);
  --border-on-dark-strong: rgba(255, 255, 255, 0.16);

  /* Type */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Geist', sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04), 0 1px 1px rgba(10, 10, 10, 0.03);
  --shadow-md: 0 6px 16px -8px rgba(10, 10, 10, 0.10), 0 2px 4px rgba(10, 10, 10, 0.04);
  --shadow-lg: 0 24px 60px -20px rgba(10, 10, 10, 0.18), 0 8px 16px -8px rgba(10, 10, 10, 0.06);
}

:root[data-theme="dark"] {
  --bg: #0c0c0a;
  --bg-elev: #131312;
  --bg-sunken: #0a0a09;
  --ink: #f5f4ee;
  --ink-2: #d8d6cd;
  --ink-3: #a6a49a;
  --ink-4: #6a6862;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Type scale */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.eyebrow.accent { color: var(--accent); }
.h-display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0;
}
.h-section {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}
.h-card {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
}
.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.body-md { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.body-lg { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.muted { color: var(--ink-3); }

/* Layout */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-tight { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.2, 0.7, 0.3, 1), background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn-primary:hover { background: #1a1a18; }
.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-accent:hover { background: var(--accent-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: rgba(10, 10, 10, 0.04); }
.btn-on-dark-ghost {
  background: transparent;
  color: var(--ink-on-dark);
  border-color: var(--border-on-dark-strong);
}
.btn-on-dark-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-on-dark-primary {
  background: var(--ink-on-dark);
  color: var(--bg-dark);
}
.btn-on-dark-primary:hover { background: white; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--bg-elev);
}
.chip-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.chip-on-dark {
  border-color: var(--border-on-dark-strong);
  color: var(--ink-on-dark-2);
  background: rgba(255, 255, 255, 0.04);
}

/* Card */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
}
.card-on-dark {
  background: var(--bg-dark-elev);
  border-color: var(--border-on-dark);
  color: var(--ink-on-dark);
}

/* Subtle grain — adds tactility, lo-cost */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: multiply;
  z-index: 0;
}

/* Animation primitives */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.35s; }
.rise-5 { animation-delay: 0.45s; }

/* Marquee for categories strip */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  gap: 56px;
  animation: marquee 60s linear infinite;
  width: max-content;
}

/* Sparkline / chart bars */
.bar { transition: height 0.3s; }
