/* Morocco Builders — jetons partagés (vitrine + tableau de bord). Charte graphique v3 : plâtre, or, terracotta.
   Thème clair « plâtre » par défaut, thème sombre « nuit » via [data-theme="dark"]. Voir docs/DESIGN.md. */

@font-face {
  font-family: "Instrument Sans";
  src: url("./fonts/instrument.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+2318, U+2713, U+2714, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("./fonts/instrument-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("./fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("./fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Reem Kufi";
  src: url("./fonts/reem-kufi-arabic-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  src: url("./fonts/noto-naskh-arabic-500.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "Noto Sans Tifinagh";
  src: url("./fonts/noto-sans-tifinagh.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+2D30-2D7F;
}

/* Palette de la charte (fixe, quel que soit le thème) */
:root {
  --platre: #f2e6dc;
  --lin: #e8d9cb;
  --sable: #d3bb9e;
  --or: #c9a24a;
  --or-clair: #ebcb7f;
  --or-fonce: #7a5b1b;
  --encre: #2a211c;
  --nuit: #17120f;
  --terracotta: #9a4632;
  --argile: #d49a82;
  --olive: #5e5c2e;
  --atlantique: #1f4d56;
  --or-degrade: linear-gradient(135deg, #d9b25c 0%, #f0d48c 55%, #b8893a 100%);
}

/* Thème plâtre (par défaut) */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: var(--platre);
  --bg-2: #ede0d4;
  --surface: #faf4ee;
  --surface-2: var(--lin);
  --text: var(--encre); /* 12,9:1 sur plâtre */
  --text-2: #5a4c42; /* 6,7:1 */
  --text-3: #6e5d50; /* 5,1:1 */
  --line: rgba(42, 33, 28, 0.13);
  --line-strong: rgba(42, 33, 28, 0.24);
  --accent: var(--terracotta); /* 5,2:1 sur plâtre, 4,6:1 sur lin */
  --accent-hi: #a9533d;
  --accent-lo: #86392a;
  --on-accent: #faf4ee;
  --brand: var(--atlantique);
  --brand-hi: #2a6370;
  --link: var(--atlantique); /* 7,6:1 */
  --ok: #4a4820; /* olive assombri : 5,5:1 même sur une pastille teintée */
  --warn: var(--or-fonce);
  --danger: #8f2a24; /* 5,4:1 même sur une pastille teintée */
  --filet: var(--or);
  --texture: url("./textures/platre.jpg");
  --texture-opacity: 1;
  --field: #fffaf5;
  --veil-thin: rgba(250, 244, 238, 0.55);
  --veil: rgba(250, 244, 238, 0.7);
  --veil-thick: rgba(250, 244, 238, 0.82);
  --veil-solid: rgba(250, 244, 238, 0.98);
  --edge-hi: rgba(255, 255, 255, 0.95);
  --edge-lo: rgba(42, 33, 28, 0.06);
  --top-light: rgba(255, 255, 255, 0.8);
  --shadow-1: 0 10px 30px -18px rgba(70, 45, 25, 0.35);
  --shadow-2: 0 26px 60px -32px rgba(70, 45, 25, 0.42);
  --shadow-3: 0 44px 90px -40px rgba(70, 45, 25, 0.5);
  --logs-bg: var(--nuit);
}

/* Thème nuit */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--nuit);
  --bg-2: #1c1612;
  --surface: #211a15;
  --surface-2: #2c231c;
  --text: var(--platre); /* 15,2:1 */
  --text-2: var(--sable); /* 10,1:1 */
  --text-3: #b39f8a; /* 7,3:1 */
  --line: rgba(242, 230, 220, 0.12);
  --line-strong: rgba(242, 230, 220, 0.22);
  --accent: var(--argile);
  --accent-hi: #e0ad97;
  --accent-lo: #c58a72;
  --on-accent: var(--nuit); /* 7,7:1 */
  --brand: var(--or-clair);
  --brand-hi: #f3dba4;
  --link: var(--or-clair);
  --ok: #a9ae6a;
  --warn: var(--or-clair);
  --danger: #f0958a;
  --filet: var(--or);
  --texture: none;
  --texture-opacity: 0;
  --field: rgba(0, 0, 0, 0.25);
  --veil-thin: rgba(242, 230, 220, 0.05);
  --veil: rgba(242, 230, 220, 0.07);
  --veil-thick: rgba(242, 230, 220, 0.1);
  --veil-solid: rgba(33, 26, 21, 0.98);
  --edge-hi: rgba(235, 203, 127, 0.4);
  --edge-lo: rgba(255, 255, 255, 0.04);
  --top-light: rgba(242, 230, 220, 0.18);
  --shadow-1: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
  --shadow-2: 0 30px 70px -36px rgba(0, 0, 0, 0.85);
  --shadow-3: 0 50px 100px -40px rgba(0, 0, 0, 0.9);
  --logs-bg: #0e0b09;
}

:root {
  --font: "Instrument Sans", -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-ar: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", system-ui, serif;
  --font-ar-display: "Reem Kufi", "Noto Naskh Arabic", sans-serif;
  --font-amazigh: "Noto Sans Tifinagh", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-1: 0.875rem;
  --fs-2: 1rem;
  --fs-3: 1.125rem;
  --fs-4: 1.375rem;
  --fs-5: 1.75rem;
  --fs-6: 2.5rem;
  --fs-7: 4rem;
  --fs-8: 6rem;
  --r-xs: 8px;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
  --r-arche: 999px 999px var(--r-m) var(--r-m);
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 140px;
  /* Mouvement : un seul moment animé par écran */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --d-retour: 120ms;
  --d-tampon: 220ms;
  --d-arche: 400ms;
  --d-fil: 600ms;
  --mx: 50%;
  --my: 0%;
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --d-retour: 0ms;
    --d-tampon: 0ms;
    --d-arche: 0ms;
    --d-fil: 0ms;
  }
}
[dir="rtl"] body,
:lang(ar) {
  font-family: var(--font-ar);
}
:lang(zgh),
.amazigh {
  font-family: var(--font-amazigh);
}
