/* ═══════════════════════════════════════════════════════════════════════════
   ECOMHUB — SOCLE
   Chaque décision ci-dessous vient de github.com/emilkowalski/skills :

   · apple-design §15 — police système d'abord (elle porte déjà l'optical
     sizing et les tables d'approche), approche selon la taille (négative en
     grand, nulle en corps), interlignage inverse de la taille, hiérarchie par
     graisse + taille + interlignage, tailles en rem pour suivre la taille de
     texte du système.
   · apple-design §12 — chrome translucide, matière plus lourde pour les
     régions structurelles, jamais de translucide clair sur translucide clair,
     surfaces plus grandes = flou et ombre plus profonds, bord supérieur clair.
   · emil-design — courbes et durées copiées du catalogue, jamais approximées.
   · apple-design §16 — but, simplicité (pas minimalisme), métier, plaisir.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* mouvement — valeurs du catalogue */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --dur-press: 120ms;
  --dur-hover: 150ms;
  --dur-pop: 200ms;
  --dur-drawer: 320ms;

  color-scheme: light;

  --bg: #f2f2f4;
  --surface: #ffffff;
  --surface-2: #f7f7f9;

  --chrome: rgba(255, 255, 255, .72);
  --chrome-strong: rgba(255, 255, 255, .9);
  --rail: rgba(28, 28, 30, .93);

  --ink: #1c1c1e;
  --ink-2: #3a3a3c;
  --mut: #6b6b70;
  --faint: #8e8e93;

  --line: rgba(0, 0, 0, .09);
  --line-2: rgba(0, 0, 0, .055);

  --accent: #0071e3;
  --ok: #0a7d43;
  --ok-soft: rgba(10, 125, 67, .10);
  --warn: #8a5a00;
  --warn-soft: rgba(138, 90, 0, .10);
  --bad: #c0362c;
  --bad-soft: rgba(192, 54, 44, .10);

  --shadow-s: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-m: 0 10px 30px -18px rgba(0, 0, 0, .28);
  --shadow-l: 0 40px 80px -40px rgba(0, 0, 0, .45);

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --pad: 20px;
}

}

*, *::before, *::after { box-sizing: border-box; }

html {
  font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: .9375rem;
  line-height: 1.5;
  letter-spacing: 0;
}

h1, h2, h3, h4 {
  margin: 0;
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.1;
}
h1 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); letter-spacing: -.022em; }
h2 { font-size: 1.25rem; letter-spacing: -.018em; }
h3 { font-size: 1rem; letter-spacing: -.012em; }
h4 { font-size: .875rem; letter-spacing: -.006em; }

p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
small, .small { font-size: .78rem; letter-spacing: .005em; }
.muted { color: var(--mut); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

code, kbd, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: .86em;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── matières ──────────────────────────────────────────────────────────────*/
.material {
  background: var(--chrome);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line);
}

.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
}

/* ── contrôles ─────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  height: 2.15rem;
  padding: 0 .85rem;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .82rem;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-hover) ease, border-color var(--dur-hover) ease,
              color var(--dur-hover) ease, opacity var(--dur-hover) ease,
              transform var(--dur-press) var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { height: 1.75rem; padding: 0 .6rem; font-size: .76rem; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--surface-2); border-color: var(--faint); }
  .btn.ink:hover { background: var(--ink-2); border-color: var(--ink-2); }
  .btn.accent:hover { filter: brightness(1.06); }
  .btn.ghost:hover { background: var(--line-2); }
}

.field, .select {
  height: 2.15rem;
  padding: 0 .7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .82rem;
  transition: border-color var(--dur-hover) ease, box-shadow var(--dur-hover) ease;
}
.field::placeholder { color: var(--faint); }
.field:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 1.45rem;
  padding: 0 .5rem;
  border-radius: 999px;
  background: var(--line-2);
  color: var(--mut);
  font-size: .72rem;
  font-weight: 550;
  letter-spacing: .005em;
  white-space: nowrap;
}
/* l'état se lit à la pastille, pas au fond : le nom reprend la main */
.pill.ok, .pill.warn, .pill.bad { background: var(--line-2); color: var(--ink-2); }
.pill.ok::before, .pill.warn::before, .pill.bad::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--mut);
}
.pill.ok::before { background: var(--ok); }
.pill.warn::before { background: var(--warn); }
.pill.bad::before { background: var(--bad); }
.pill.neutral { background: var(--line-2); color: var(--mut); }

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .material {
    background: var(--chrome-strong);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root { --line: color-mix(in srgb, var(--ink) 35%, transparent); }
  .material { backdrop-filter: none; background: var(--surface); border-color: var(--ink); }
}
