Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOURCE FILE4 * =============================================================================5 * Project : Vrai-Prix6 * File : src/styles/tokens.css7 * Author : Simon-Pierre Boucher | https://spboucher.ai8 * Contact : contact@spboucher.ai9 * Copyright : (c) 2026 Simon-Pierre Boucher10 * License : None specified (no license file in this repository)11 * =============================================================================12 * END OF SP BOUCHER SOURCE HEADER13 * =============================================================================14 */1516/* -----------------------------------------------------------------------------17 Jetons de design et socle de composants de Vrai-Prix (interface héritée de la18 v1, en attente de la refonte). Typo, palette, espacements, échelle z-index,19 boutons, champs, tableaux, règles mobiles.20----------------------------------------------------------------------------- */2122:root {23 /* ---- Palette de base ---- */24 --paper: #f5f3ee;25 --surface: #ffffff;26 --surface-2: #faf9f5;27 --ink: #141814;28 --ink-2: #4d5551;29 --ink-3: #8b928c;30 --line: rgba(20, 24, 20, 0.14);31 --line-strong: rgba(20, 24, 20, 0.85);32 --green: #1c5c41;33 --green-deep: #123f2e;34 --amber: #e8a33d;35 --amber-soft: #fdf3e2;36 --danger: #b3423a;37 --danger-soft: #fbe9e7;3839 /* ---- ACCENT du site — SEULES variables surchargées par marque ---- */40 --accent: #d9f26b; /* défaut (surchargé dans globals.css) */41 --accent-soft: #f0f9d2;42 --accent-deep: #123f2e;43 --on-accent: var(--ink); /* couleur du texte posé SUR l'accent */4445 /* alias rétro-compatibles (les satellites historiques utilisent --lime) */46 --lime: var(--accent);47 --lime-soft: var(--accent-soft);4849 /* ---- Géométrie sharp ---- */50 --r-card: 10px;51 --r-ctl: 6px;52 --r-pill: 999px;5354 /* ---- Ombres décalées — la signature du groupe ---- */55 --shadow-flat: 0 1px 2px rgba(20, 24, 20, 0.05);56 --shadow-off: 6px 6px 0 var(--ink);57 --shadow-off-soft: 8px 8px 0 rgba(20, 24, 20, 0.08);58 --shadow-off-mid: 4px 4px 0 rgba(20, 24, 20, 0.18);5960 /* ---- Typographie ---- */61 --font-display: "Space Grotesk", system-ui, sans-serif;62 --font-body: "Inter", system-ui, sans-serif;63 --font-mono: "JetBrains Mono", ui-monospace, monospace;6465 /* Échelle fluide (mobile-first, clamp) */66 --fs-h1: clamp(30px, 3.2vw + 18px, 54px);67 --fs-h2: clamp(23px, 1.8vw + 14px, 34px);68 --fs-h3: clamp(17px, 0.9vw + 12px, 22px);69 --fs-body: 15px;70 --fs-small: 13px;7172 /* Espacements */73 --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;74 --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;7576 /* Cible tactile minimale */77 --touch: 44px;7879 /* ---- Échelle z-index COMMUNE (obligatoire — aucune valeur arbitraire) ----80 grain de film body::before = 9999 (pointer-events:none, toujours au-dessus,81 purement visuel). Tout composant interactif se place sous 9999 : */82 --z-content: 1; /* contenu positionné ordinaire */83 --z-sticky: 300; /* éléments sticky de contenu (sous-nav…) */84 --z-header: 500; /* header du site */85 --z-bottombar: 600; /* tab bar / barre d'action basse */86 --z-dropdown: 700; /* menus déroulants (au-dessus des barres) */87 --z-overlay: 800; /* voile sous modale/panneau */88 --z-modal: 900; /* modales, panneaux de filtres, galeries */89 --z-toast: 950; /* notifications */9091 /* ---- Hauteur de viewport DYNAMIQUE (barre du navigateur mobile qui se92 replie au scroll) : toujours var(--vh100), JAMAIS 100vh en dur. ---- */93 --vh100: 100vh;94}95@supports (height: 100dvh) { :root { --vh100: 100dvh; } }9697/* ---- Socle ---- */98* { box-sizing: border-box; }99/* overflow-x: clip sur html ET body — sur WebKit iOS, clip posé sur body seul100 ne bloque PAS le défilement latéral du viewport (quirk de propagation) ;101 clip (≠ hidden) ne casse pas position:sticky. */102html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }103body {104 margin: 0;105 background: var(--paper);106 color: var(--ink);107 font-family: var(--font-body);108 font-size: var(--fs-body);109 line-height: 1.55;110 -webkit-font-smoothing: antialiased;111 padding-bottom: env(safe-area-inset-bottom);112 overflow-x: clip; /* jamais de débordement horizontal */113}114img, svg, video { max-width: 100%; height: auto; display: block; }115h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.03em; margin: 0 0 0.5em; }116h1 { font-size: var(--fs-h1); line-height: 1.06; }117h2 { font-size: var(--fs-h2); line-height: 1.15; }118h3 { font-size: var(--fs-h3); line-height: 1.25; }119a { color: inherit; }120::selection { background: var(--accent); color: var(--on-accent); }121:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }122123/* Grain de film pleine page — ⚠️ jamais de z-index sur body > * (position:124 relative seulement), sinon les utilitaires z-* sont écrasés. */125body::before {126 content: "";127 position: fixed; inset: 0; pointer-events: none; opacity: 0.35; z-index: 9999;128 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.06'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");129}130body > * { position: relative; }131132/* ---- Conteneur commun ---- */133.container { max-width: 1152px; margin: 0 auto; padding: 0 var(--sp-4); }134@media (min-width: 768px) { .container { padding: 0 var(--sp-5); } }135136/* ---- Micro-typographie signature ---- */137.kicker {138 display: inline-flex; align-items: center; gap: 10px;139 font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;140 text-transform: uppercase; letter-spacing: 0.12em; color: var(--green);141}142.kicker::before { content: ""; width: 22px; height: 2px; background: var(--green); }143.klabel {144 font-family: var(--font-mono); font-size: 10px; font-weight: 700;145 text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3);146}147.hl {148 display: inline-block; background: var(--accent); color: var(--on-accent);149 border-radius: 8px; padding: 0 10px 2px; transform: rotate(-1deg);150}151.outline-txt { color: transparent; -webkit-text-stroke: 2px var(--ink); }152153/* ---- Boutons (cible ≥ 44 px) ---- */154.btn {155 display: inline-flex; align-items: center; justify-content: center; gap: 8px;156 min-height: var(--touch); padding: 10px 18px;157 font-family: var(--font-display); font-weight: 700; font-size: 14px;158 border: 1.5px solid var(--ink); border-radius: var(--r-ctl);159 background: var(--surface); color: var(--ink);160 cursor: pointer; text-decoration: none;161 transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;162}163.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-off-mid); }164.btn:active { transform: translate(0, 0); box-shadow: none; }165.btn:disabled { opacity: 0.45; pointer-events: none; }166.btn-primary { background: var(--ink); color: var(--accent); }167.btn-primary:hover { background: var(--accent-deep); }168.btn-accent { background: var(--accent); color: var(--on-accent); }169.btn-ghost { background: transparent; border-color: var(--line); }170.btn-ghost:hover { border-color: var(--ink); }171172/* ---- Cartes ---- */173.card {174 background: var(--surface); border: 1.5px solid var(--ink);175 border-radius: var(--r-card); box-shadow: var(--shadow-off-soft);176 overflow: hidden;177}178.card-hover { transition: transform 0.15s, box-shadow 0.15s; }179.card-hover:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-off); }180181/* ---- Chips / badges ---- */182.chip {183 display: inline-flex; align-items: center; gap: 6px;184 padding: 4px 11px; font-family: var(--font-mono); font-size: 11px; font-weight: 700;185 text-transform: uppercase; letter-spacing: 0.06em;186 border: 1.5px solid var(--ink); border-radius: var(--r-pill);187 background: var(--surface); color: var(--ink);188}189.chip-accent { background: var(--accent); color: var(--on-accent); }190.chip-soft { background: var(--accent-soft); border-color: var(--line); }191192/* ---- Champs ---- */193.input, .select, .textarea {194 width: 100%; min-height: var(--touch); padding: 10px 14px;195 font: inherit; color: var(--ink); background: var(--surface);196 border: 1.5px solid var(--ink); border-radius: var(--r-ctl);197}198.input:focus, .select:focus, .textarea:focus {199 outline: none; box-shadow: 3px 3px 0 var(--accent); border-color: var(--ink);200}201.input::placeholder { color: var(--ink-3); }202203/* ---- Tableaux → cartes empilées sous 768 px ---- */204.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }205@media (max-width: 767px) {206 .tbl-stack thead { display: none; }207 .tbl-stack tr { display: block; border: 1.5px solid var(--ink); border-radius: var(--r-card); margin-bottom: var(--sp-3); background: var(--surface); }208 .tbl-stack td { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 8px 12px; border: 0; }209 .tbl-stack td::before { content: attr(data-label); font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }210}211212/* ---- Utilitaires responsive ---- */213.only-mobile { display: initial; } .only-desktop { display: none; }214@media (min-width: 768px) { .only-mobile { display: none; } .only-desktop { display: initial; } }215216/* =============================================================================217 SOCLE MOBILE OBLIGATOIRE (2026-08-19) — règles du socle mobile.218 RÈGLES pour tout composant futur :219 · TAP, jamais :hover, pour ouvrir un menu (le survol n'existe pas au doigt) ;220 le :hover ne sert qu'aux effets décoratifs, sous @media (hover: hover).221 · var(--vh100) (dvh) et JAMAIS 100vh pour tout élément calé sur le viewport.222 · position:fixed exige qu'AUCUN ancêtre n'ait transform/filter/perspective/223 will-change/backdrop-filter — sinon monter l'élément à la racine (body).224 · Barre basse fixe = .vp-bottombar + classe has-bottombar sur <body>.225 · Menu/panneau ouvert = .vp-scroll-lock sur <html> (scroll arrière-plan gelé).226 · z-index : uniquement l'échelle --z-* ci-dessus.227 · Zones tactiles ≥ var(--touch) (44 px), champs ≥ 16 px (zoom iOS).228 ========================================================================== */229230/* Anti-zoom iOS : au doigt, aucun champ sous 16 px (le focus d'un champ <16 px231 déclenche un zoom automatique de page sur Safari iOS). !important assumé :232 c'est un filet d'accessibilité, un champ plus petit casse le zoom quoi233 qu'il arrive — ne s'applique qu'aux écrans tactiles. */234@media (hover: none) and (pointer: coarse) {235 input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),236 select, textarea { font-size: max(16px, 1em) !important; }237}238239/* Hauteurs viewport dynamiques */240.h-viewport { height: 100vh; height: 100dvh; }241.min-h-viewport { min-height: 100vh; min-height: 100dvh; }242243/* Barre fixe basse fiable : safe-area iPhone incluse, immunisée contre les244 transforms accidentels, et compensation d'espace via body.has-bottombar. */245.vp-bottombar {246 position: fixed; left: 0; right: 0; bottom: 0;247 z-index: var(--z-bottombar);248 padding-bottom: env(safe-area-inset-bottom, 0px);249 background: var(--surface);250 border-top: 1.5px solid var(--ink);251 transform: none !important; filter: none !important;252}253body.has-bottombar { padding-bottom: calc(var(--bottombar-h, 64px) + env(safe-area-inset-bottom, 0px)); }254255/* Verrou de scroll d'arrière-plan (menu mobile, modale, panneau de filtres256 ouverts) : ajouter/retirer .vp-scroll-lock sur <html>. */257html.vp-scroll-lock, html.vp-scroll-lock body { overflow: hidden !important; overscroll-behavior: none; }258259/* Menu déroulant de référence : au-dessus de tout contenu (cartes Mapbox260 incluses), défilement interne avec élan, jamais plus haut que l'écran. */261.vp-menu {262 position: absolute; z-index: var(--z-dropdown);263 min-width: 180px;264 max-height: min(60vh, 420px); max-height: min(60dvh, 420px);265 overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;266 background: var(--surface); border: 1.5px solid var(--ink);267 border-radius: var(--r-card); box-shadow: var(--shadow-off-mid);268}269.vp-menu a, .vp-menu button, .vp-menu label, .vp-menu [role="menuitem"], .vp-menu [role="option"] {270 display: flex; align-items: center; min-height: var(--touch);271 padding: 10px 14px; width: 100%; text-decoration: none;272}273/* Voile plein écran sous une modale / un panneau */274.vp-overlay {275 position: fixed; inset: 0; z-index: var(--z-overlay);276 background: rgba(20, 24, 20, 0.45);277}278