/* Des commerçants en or – nantinelle.fr/commercants-en-or */
@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url('fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url('fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: Barlow; font-weight: 800; font-display: swap; src: url('fonts/barlow-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }

:root {
  --vert: #0b5e33;
  --vert-fonce: #073d21;
  --jaune: #ffd200;
  --or: #c9a227;
  --or-fonce: #7a5a0a;
  --rouge: #b3202a;
  --ivoire: #fbf9f3;
  --encre: #16241c;
  --gris: #4f5a54;
  --ligne: #dfe3dc;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivoire); color: var(--encre); font-family: Barlow, system-ui, sans-serif; font-size: 17px; line-height: 1.55; }
a { color: var(--vert); }
a:hover { color: var(--vert-fonce); }
h1, h2, h3 { font-family: Barlow, system-ui, sans-serif; font-weight: 800; line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.kicker { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; font-size: 15px; }

/* En-tête */
.hero { position: relative; display: flow-root; overflow: visible; background: var(--vert); color: #fff; padding: 52px 0 0; }
.hero .semis { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .12; pointer-events: none; }
.hero .wrap { position: relative; }
.hero .kicker { color: var(--jaune); }
.hero h1 { font-size: clamp(44px, 9vw, 88px); margin: 12px 0 14px; letter-spacing: -.015em; }
.hero h1 span { color: var(--jaune); }
.hero .dates { font-size: clamp(19px, 3vw, 24px); font-weight: 600; }
.hero .lead { margin-top: 10px; max-width: 600px; color: #e6f0e9; }
.pile { position: relative; z-index: 2; display: block; width: min(440px, 88%); margin: -6px 0 -64px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.2)); }
.stripe { position: relative; z-index: 1; height: 14px; background: var(--jaune); }
.after-hero { padding-top: 70px; }

/* Blocs */
section { padding: 46px 0; }
section + section { border-top: 1px solid var(--ligne); }
h2 { font-size: clamp(28px, 4.4vw, 38px); margin-bottom: 20px; color: var(--vert); }
h2 .star { color: var(--or); font-size: .7em; vertical-align: .12em; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { background: #fff; padding: 22px 22px 24px; border: 2px solid var(--vert); border-radius: 14px; position: relative; }
.steps li::after { content: ""; position: absolute; inset: 4px; border: 1.5px solid var(--jaune); border-radius: 10px; pointer-events: none; }
.steps li::before { counter-increment: s; content: counter(s); display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--vert); color: var(--jaune); font-weight: 800; font-size: 22px; margin-bottom: 12px; }
.steps strong { display: block; font-size: 20px; margin-bottom: 4px; color: var(--vert); }
.note { margin-top: 18px; padding: 14px 18px; background: var(--jaune); color: var(--encre); font-weight: 600; border-radius: 10px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.fact { background: #fff; border-radius: 14px; padding: 20px; border-top: 6px solid var(--vert); box-shadow: 0 1px 0 var(--ligne); }
.fact .big { font-weight: 800; font-size: 28px; line-height: 1.1; color: var(--vert); }
.fact .small { color: var(--gris); font-size: 15px; margin-top: 6px; }
.fact.gold { border-top-color: var(--jaune); }

/* Carte + liste */
#carte { height: 540px; border: 2px solid var(--vert); border-radius: 14px; background: #eee; }
.leaflet-tile-pane { filter: grayscale(1) contrast(1.12); }
.osm-fallback { filter: grayscale(1) contrast(.75) brightness(1.12); }
.lingot-icon { background: none; border: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.leaflet-popup-content { font-family: Barlow, sans-serif; font-size: 15px; margin: 10px 14px; }
.leaflet-popup-content strong { font-size: 16px; display: block; color: var(--vert); }
.map-hint { color: var(--gris); font-size: 15px; margin: -8px 0 16px; }
.search { display: flex; flex-direction: column; gap: 6px; margin: 24px 0 14px; max-width: 420px; }
.search label { font-weight: 600; }
.search input { font: inherit; padding: 12px 14px; border: 2px solid var(--vert); border-radius: 10px; min-height: 48px; background: #fff; }
.search input:focus { outline: 3px solid var(--jaune); outline-offset: 1px; }
.list { list-style: none; margin: 0; padding: 0; columns: 3 240px; column-gap: 28px; }
.list li { break-inside: avoid; border-bottom: 1px solid var(--ligne); }
.list button { all: unset; display: block; width: 100%; padding: 10px 0; cursor: pointer; min-height: 44px; box-sizing: border-box; }
.list button:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.list .n { font-weight: 600; display: block; }
.list .a { color: var(--gris); font-size: 15px; }
.list button:hover .n { color: var(--vert); text-decoration: underline; }
.count { color: var(--gris); font-size: 15px; margin-top: 12px; }
.support { margin-top: 18px; color: var(--gris); font-size: 15px; }

/* Bouton */
.btn { display: inline-flex; align-items: center; min-height: 50px; padding: 12px 24px; background: var(--vert); color: #fff; text-decoration: none; font-weight: 800; border-radius: 999px; border-bottom: 4px solid var(--jaune); }
.btn:hover { background: var(--vert-fonce); color: #fff; }

/* Pied */
footer { background: var(--vert-fonce); color: #d6e4da; padding: 30px 0 42px; font-size: 15px; border-top: 10px solid var(--jaune); }
footer a { color: var(--jaune); }
footer a:hover { color: #fff; }
footer p + p { margin-top: 6px; }

/* Règlement */
.hero.small { padding-bottom: 40px; }
.hero.small h1 { font-size: clamp(34px, 6vw, 56px); }
.rules { max-width: 760px; }
.rules h2 { font-size: 22px; margin: 34px 0 10px; }
.rules p, .rules li { margin-bottom: 10px; }
.rules ul { padding-left: 22px; margin: 0 0 10px; }
.back { display: inline-block; margin-top: 12px; color: var(--jaune); font-weight: 600; }
.back:hover { color: #fff; }

@media (max-width: 600px) {
  .hero { padding-top: 36px; }
  .pile { margin-bottom: -44px; }
  .after-hero { padding-top: 52px; }
  #carte { height: 440px; }
  section { padding: 36px 0; }
}

/* Mosaïque des commerçants */
.mosaic { margin: 0; border-radius: 14px; overflow: hidden; border: 2px solid var(--vert); box-shadow: 0 6px 0 var(--jaune); }
.mosaic img { display: block; width: 100%; height: auto; }

.mb { margin-bottom: 18px; }
.signed { margin-top: 34px; color: #555; }

/* ---------- Barre du haut ---------- */
.topbar { background: var(--vert-fonce); color: #fff; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.brand img { border-radius: 7px; display: block; }
.topbar nav { display: flex; gap: 6px; }
.topbar nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; min-height: 40px; display: inline-flex; align-items: center; }
.topbar nav a:hover { background: rgba(255,210,0,.18); color: var(--jaune); }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }

/* ---------- Compteur ---------- */
.countdown { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; background: var(--jaune); color: var(--encre); font-weight: 800; padding: 8px 16px; border-radius: 999px; font-size: 16px; }
.countdown:empty { display: none; }
.countdown::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rouge); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .45; } }

/* ---------- Lingots qui flottent + reflet ---------- */
.pile { animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- Chiffres clés ---------- */
.stats { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stats li { background: var(--vert); color: #fff; border-radius: 14px; padding: 18px 16px; text-align: center; position: relative; overflow: hidden; }
.stats li::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--jaune); }
.stats b { display: block; font-size: 40px; line-height: 1; color: var(--jaune); font-weight: 800; }
.stats span { display: block; margin-top: 6px; font-size: 15px; color: #e3efe7; }

.intro { font-size: 19px; max-width: 760px; margin: -6px 0 22px; color: var(--encre); }

/* ---------- Interactions ---------- */
.steps li, .fact, .stats li { transition: transform .25s ease, box-shadow .25s ease; }
.steps li:hover, .fact:hover, .stats li:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(11,94,51,.16); }
.mosaic img { transition: transform 6s ease; }
.mosaic:hover img { transform: scale(1.03); }
.btn { transition: transform .2s ease, background .2s ease; }
.btn:hover { transform: translateY(-2px); }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Lingots du plan qui tombent */
.lingot-icon img { animation: drop .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Bouton flottant (mobile) */
.fab { position: fixed; right: 16px; bottom: 16px; z-index: 900; background: var(--jaune); color: var(--encre); font-weight: 800; text-decoration: none; padding: 14px 20px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.25); display: none; min-height: 48px; }
@media (max-width: 760px) { .fab { display: inline-flex; align-items: center; } .topbar nav a:first-child { display: none; } }


/* Encart pétition */
.petition-wrap { padding-top: 10px; }
.petition { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: #fff; border: 2px solid var(--vert); border-left: 10px solid var(--jaune); border-radius: 14px; padding: 20px 24px; }
.petition .kicker { color: var(--vert); font-size: 13px; }
.petition .pt { font-weight: 800; font-size: 22px; color: var(--encre); margin-top: 4px; }
.petition .ps { color: var(--gris); font-size: 15px; margin-top: 2px; }
.btn-y { background: var(--jaune); color: var(--encre); border-bottom-color: var(--vert); }
.btn-y:hover { background: #ffe14d; color: var(--encre); }

/* ================= V3 : animations et confort ================= */
.brand img { border-radius: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.brand span { font-size: 17px; }
.brand em { font-style: normal; color: var(--jaune); }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--jaune); transform-origin: 0 50%; transform: scaleX(0); }
.topbar { position: sticky; }

/* Entrée du héros */
.hero .kicker, .hero h1, .hero .dates, .hero .countdown, .hero .lead { animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
.hero h1 { animation-delay: .1s; } .hero .dates { animation-delay: .2s; } .hero .countdown { animation-delay: .3s; } .hero .lead { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero h1 span { background: linear-gradient(100deg, var(--jaune) 0 40%, #fff6b8 50%, var(--jaune) 60% 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 5s ease-in-out 1.6s infinite; }
@keyframes sheen { 0% { background-position: 100% 0; } 30%,100% { background-position: 0 0; } }
.hero .semis { animation: drift 60s linear infinite; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-46px); } }

/* Lingots qui s'empilent */
.pile .ing { transform-box: fill-box; animation: ingdrop .7s cubic-bezier(.3,1.35,.5,1) both; }
.pile .ing1 { animation-delay: .5s; } .pile .ing2 { animation-delay: .65s; } .pile .ing3 { animation-delay: .8s; } .pile .ing4 { animation-delay: .95s; } .pile .ing5 { animation-delay: 1.15s; }
@keyframes ingdrop { from { opacity: 0; transform: translateY(-60px); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }

/* Compte à rebours */
.countdown { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; background: rgba(0,0,0,.18); color: #fff; padding: 10px 12px; border-radius: 14px; font-weight: 600; }
.countdown::before { display: none; }
.cd-l { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .12em; font-size: 14px; color: var(--jaune); margin-right: 4px; display: inline-flex; align-items: center; gap: 8px; }
.cd-l::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ff5a5f; animation: pulse 1.6s ease-in-out infinite; }
.cd-u { display: inline-flex; align-items: baseline; gap: 3px; background: var(--jaune); color: var(--encre); border-radius: 8px; padding: 4px 9px; }
.cd-u b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 1.3em; text-align: center; }
.cd-u i { font-style: normal; font-size: 13px; font-weight: 600; }
.countdown.txt .cd-u { display: none; }

/* Apparition en cascade */
.stagger > * { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(2) { transition-delay: .12s; } .stagger.in > *:nth-child(3) { transition-delay: .24s; } .stagger.in > *:nth-child(4) { transition-delay: .36s; }
.reveal.stagger { opacity: 1; transform: none; }

/* Passeport animé */
.demo { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 26px; align-items: center; margin-top: 26px; }
.demo-card { all: unset; box-sizing: border-box; cursor: pointer; display: block; background: #fff; border: 2px solid var(--vert); border-radius: 16px; padding: 18px; box-shadow: 0 6px 0 var(--jaune); position: relative; }
.demo-card:focus-visible { outline: 3px solid var(--jaune); outline-offset: 3px; }
.demo-t { display: block; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--vert); text-align: center; margin-bottom: 12px; }
.demo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #c9d3cc; display: flex; align-items: center; justify-content: center; position: relative; }
.tp em { font-style: normal; font-weight: 600; color: #b5c0b9; font-size: 15px; }
.tp img { position: absolute; width: 62%; height: auto; opacity: 0; }
.tp.on { border: 2px solid var(--vert); background: var(--vert); animation: stamp .35s cubic-bezier(.3,1.6,.5,1); }
.tp.on em { opacity: 0; }
.tp.on img { opacity: 1; }
@keyframes stamp { from { transform: scale(1.7) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
.demo-s { display: block; text-align: center; margin-top: 14px; font-weight: 800; color: var(--gris); transition: color .3s; }
.demo.done .demo-s { color: var(--vert); }
.demo.done .demo-card { animation: glow 1.2s ease; }
@keyframes glow { 40% { box-shadow: 0 6px 0 var(--jaune), 0 0 0 8px rgba(255,210,0,.45); } }
.demo-big { font-weight: 800; font-size: clamp(24px, 3.4vw, 32px); color: var(--vert); line-height: 1.1; margin-bottom: 8px; }
@media (max-width: 700px) { .demo { grid-template-columns: 1fr; } }

/* Mosaïque vivante */
.mosaic.in img { animation: kb 24s ease-in-out infinite alternate; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.06) translate(-1%, -1%); } }
.mosaic:hover img { transform: none; }

/* Lingot à gagner qui brille */
.fact.gold { position: relative; overflow: hidden; }
.fact.gold::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,210,0,.28), transparent); animation: sweep 4.5s ease-in-out 1s infinite; }
@keyframes sweep { 0% { left: -60%; } 35%,100% { left: 120%; } }

/* Commerce le plus proche */
.near { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.near .btn { border: 0; font: inherit; font-weight: 800; cursor: pointer; border-bottom: 4px solid var(--vert); }
.near-r { color: var(--vert); font-weight: 600; }
.lingot-icon.hit img { animation: bounce .8s ease 2; }
@keyframes bounce { 30% { transform: translateY(-12px) scale(1.25); } 60% { transform: none; } }

/* FAQ */
.faq { max-width: 820px; display: grid; gap: 10px; }
.faq details { background: #fff; border: 2px solid var(--ligne); border-radius: 12px; transition: border-color .2s; }
.faq details[open] { border-color: var(--vert); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 48px 14px 18px; font-weight: 800; font-size: 18px; position: relative; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--vert); color: var(--jaune); display: flex; align-items: center; justify-content: center; font-size: 20px; transition: transform .25s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 18px 16px; color: var(--gris); animation: rise .35s ease both; }
.faq summary:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; border-radius: 10px; }

@media (max-width: 600px) { .brand span { font-size: 15px; } .cd-u b { font-size: 19px; } }


/* Réglage « réduire les animations » (souvent actif par défaut sur PC Windows) :
   on garde les apparitions en fondu, on coupe seulement les mouvements continus */
@media (prefers-reduced-motion: reduce) {
  .pile, .hero .semis, .mosaic.in img { animation: none; }
  html { scroll-behavior: auto; }
}
