/* Dossier de Lons-le-Saunier : page d'entrée de tamairie.fr (maquette). Carte vivante en fond, titre XXL, compteurs, sections. */
:root {
  --fond: #0a0c0f; --fond-2: #10141a; --fond-3: #161c23; --trait: #222a33; --trait-2: #2f3a45;
  --texte: #e9e4d8; --texte-2: #a3abb4; --texte-3: #8a95a0;
  --jaune: #e3b456; --cuivre: #e0583f; --menthe: #5fd6a6; --bleu: #6aa6ff; --sel: #f4efe3;
  --ui: "Archivo", "Segoe UI", system-ui, sans-serif; --mono: "Roboto Mono", "Cascadia Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.5 var(--ui); overflow-x: hidden; }
a { color: var(--jaune); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
::selection { background: var(--jaune); color: #000; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1 !important; transform: none !important; transition: none !important; } .mot { animation: none !important; } }

/* ---------- barre */
.barre { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: linear-gradient(rgba(10, 12, 15, .85), rgba(10, 12, 15, 0)); }
.barre .marque { display: flex; align-items: center; gap: 10px; font-weight: 600; color: inherit; }
.barre .marque:hover { text-decoration: none; }
.barre .marque small { color: var(--texte-2); font-weight: 400; font-family: var(--mono); font-size: 12px; }
.sceau { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--jaune) 0 25%, var(--cuivre) 0 50%, var(--menthe) 0 75%, var(--sel) 0); box-shadow: inset 0 0 0 4px var(--fond); }
.barre nav { margin-left: auto; display: flex; gap: 22px; font-size: 14px; color: var(--texte-2); }
.barre nav a { color: inherit; }
.barre .indep { font: 11px var(--mono); color: var(--texte-3); }
.bouton { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; border: 1px solid var(--trait-2); color: var(--texte); background: rgba(16, 20, 26, .8); backdrop-filter: blur(8px); transition: transform .15s, border-color .15s; }
.bouton:hover { border-color: var(--jaune); text-decoration: none; transform: translateY(-1px); }
.bouton.principal { background: var(--sel); color: #0a0c0f; border-color: var(--sel); }
.bouton.principal:hover { background: #fff; }

/* ---------- hero */
.hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .voile { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 12, 15, .92) 0%, rgba(10, 12, 15, .55) 38%, rgba(10, 12, 15, .05) 70%), linear-gradient(0deg, var(--fond) 0%, rgba(10, 12, 15, .2) 30%, rgba(10, 12, 15, 0) 60%); pointer-events: none; }
.hero .brume { position: absolute; inset: 0; background: radial-gradient(60% 50% at 70% 45%, rgba(20, 28, 38, 0) 0%, rgba(10, 12, 15, .35) 100%); pointer-events: none; }
.hero .texte { position: absolute; left: 28px; bottom: 70px; max-width: 700px; z-index: 2; }
.surligne { font: 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--texte-2); margin: 0 0 18px; }
.surligne i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--menthe); box-shadow: 0 0 10px var(--menthe); margin-right: 10px; vertical-align: 1px; }
h1 { margin: 0 0 18px; font-size: clamp(44px, 7.2vw, 104px); line-height: .98; letter-spacing: -.035em; font-weight: 500; }
h1 .mot { display: inline-block; animation: monte .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(120ms + var(--i, 0) * 110ms); }
@keyframes monte { from { opacity: 0; transform: translateY(26px); } }
h1 .pale { color: var(--texte-2); }
.hero p.chapeau { margin: 0 0 24px; font-size: 18px; color: var(--texte-2); max-width: 560px; min-height: 3.1em; }
.hero p.chapeau b { color: var(--texte); font-weight: 500; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.direct { position: absolute; right: 28px; bottom: 70px; width: 360px; min-height: 300px; z-index: 2; padding: 18px 18px 16px; border-radius: 14px; background: rgba(16, 20, 26, .82); border: 1px solid var(--trait-2); backdrop-filter: blur(12px); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.direct h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-2); display: flex; align-items: center; gap: 8px; }
.direct h2 i { width: 8px; height: 8px; border-radius: 50%; background: var(--menthe); box-shadow: 0 0 10px var(--menthe); animation: pouls 2s infinite; }
@keyframes pouls { 50% { opacity: .35; } }
.direct .ligne { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--trait); font-size: 13.5px; }
.direct .ligne span { color: var(--texte-2); }
.direct .ligne b { font-family: var(--mono); font-weight: 500; font-size: 13px; text-align: right; }
.direct .ligne small { display: block; color: var(--texte-3); font-size: 12px; margin-top: 2px; }
.direct .ligne:first-of-type { border-top: 0; padding-top: 0; }
.direct .ligne.acte { grid-template-columns: 1fr; }
.direct .ligne.acte b { text-align: left; font-family: var(--ui); font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.direct .lien { display: block; margin-top: 12px; text-align: center; padding: 10px; border-radius: 9px; background: var(--fond-3); border: 1px solid var(--trait-2); font-size: 13px; }
.defile { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); color: var(--texte-3); font: 11px var(--mono); letter-spacing: .14em; z-index: 2; }

/* ---------- sections */
section.bloc { max-width: 1180px; margin: 0 auto; padding: 96px 28px 20px; }
.entete { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: end; margin-bottom: 36px; }
.entete h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.02; letter-spacing: -.03em; font-weight: 500; }
.entete p { margin: 0; color: var(--texte-2); font-size: 15px; }
.numero { font: 12px var(--mono); letter-spacing: .14em; color: var(--jaune); margin-bottom: 14px; display: block; }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.on { opacity: 1; transform: none; }

/* tuiles de chiffres */
.tuiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tuile { padding: 18px 18px 16px; border: 1px solid var(--trait); border-radius: 12px; background: var(--fond-2); }
.tuile b { display: block; font-size: 34px; line-height: 1; letter-spacing: -.03em; font-weight: 500; font-family: var(--mono); }
.tuile b small { font-size: 16px; color: var(--texte-2); margin-left: 4px; font-family: var(--ui); }
.tuile span { display: block; margin-top: 8px; color: var(--texte-2); font-size: 13px; }
.tuile em { display: block; font-style: normal; color: var(--texte-3); font: 11px var(--mono); margin-top: 6px; }
.tuile.chaud b { color: var(--cuivre); } .tuile.or b { color: var(--jaune); } .tuile.menthe b { color: var(--menthe); }

/* chantiers */
.cartes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.carte { position: relative; display: block; padding: 18px; border: 1px solid var(--trait); border-radius: 14px; background: var(--fond-2); color: inherit; overflow: hidden; transition: border-color .15s, transform .15s; }
.carte:hover { border-color: var(--trait-2); transform: translateY(-2px); text-decoration: none; }
.carte .etat { display: inline-flex; align-items: center; gap: 6px; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--texte-2); margin-bottom: 12px; }
.carte .etat i { width: 8px; height: 8px; border-radius: 2px; }
.carte h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.3; font-weight: 500; }
.carte .cout { font-family: var(--mono); font-size: 24px; letter-spacing: -.02em; }
.carte .cout small { font-size: 12px; color: var(--texte-3); margin-left: 6px; }
.carte .meta { margin-top: 10px; color: var(--texte-3); font-size: 12.5px; }
.carte .jauge { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--trait); }
.carte .jauge i { display: block; height: 100%; }
.suite { margin: 18px 0 0; display: flex; gap: 14px; align-items: center; color: var(--texte-2); font-size: 14px; }

/* barres */
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.barres h3, .liste h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-2); }
.barre-l { display: grid; grid-template-columns: 1fr 90px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--trait); font-size: 14px; }
.barre-l i { display: block; height: 6px; border-radius: 3px; background: var(--jaune); margin-top: 5px; transform-origin: left; transform: scaleX(0); transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.on .barre-l i { transform: scaleX(1); }
.barre-l b { font-family: var(--mono); font-weight: 500; font-size: 13px; text-align: right; }
.barre-l small { color: var(--texte-3); font-size: 12px; }
svg.annees { width: 100%; height: 150px; display: block; }
.liste ol { list-style: none; margin: 0; padding: 0; }
.liste li { padding: 10px 0; border-bottom: 1px solid var(--trait); font-size: 14px; }
.liste li small { display: block; color: var(--texte-3); font-size: 12px; margin-top: 3px; font-family: var(--mono); }
.liste li em { font-style: normal; color: var(--jaune); font-family: var(--mono); font-size: 12px; }

/* décideurs */
.maires { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.maire { padding: 16px; border: 1px solid var(--trait); border-radius: 12px; background: var(--fond-2); }
.maire b { display: block; font-size: 18px; font-weight: 500; }
.maire span { display: block; color: var(--texte-2); font-size: 13px; margin-top: 4px; }
.maire em { display: block; font-style: normal; color: var(--texte-3); font: 12px var(--mono); margin-top: 8px; }
.maire.actuel { border-color: var(--jaune); }
.duel { margin-top: 24px; }
.duel .ligne { display: grid; grid-template-columns: 200px 1fr 120px; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; }
.duel .ligne i { display: block; height: 14px; border-radius: 3px; background: var(--jaune); transform-origin: left; transform: scaleX(0); transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.on .duel .ligne i { transform: scaleX(1); }
.duel .ligne b { font-family: var(--mono); font-weight: 500; text-align: right; }
.duel p { margin: 10px 0 0; color: var(--texte-3); font: 12px var(--mono); }

/* fabrique et pied */
.fabrique-lien { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 28px; border: 1px solid var(--trait-2); border-radius: 16px; background: linear-gradient(135deg, var(--fond-2), var(--fond-3)); }
.fabrique-lien h3 { margin: 0 0 6px; font-size: 22px; font-weight: 500; }
.fabrique-lien p { margin: 0; color: var(--texte-2); font-size: 14px; }
.strates-mini { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.strates-mini span { font: 11px var(--mono); letter-spacing: .08em; padding: 4px 9px; border: 1px solid var(--trait-2); border-radius: 999px; color: var(--texte-2); }
footer { max-width: 1180px; margin: 60px auto 0; padding: 30px 28px 50px; border-top: 1px solid var(--trait); color: var(--texte-3); font-size: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
footer b { color: var(--texte-2); font-weight: 500; }

@media (max-width: 1000px) {
  .entete, .deux, footer { grid-template-columns: 1fr; }
  .tuiles { grid-template-columns: repeat(2, 1fr); }
  .cartes, .maires { grid-template-columns: 1fr 1fr; }
  .direct { position: static; width: auto; margin: 20px 28px 0; }
  .hero { height: auto; min-height: 100vh; padding-bottom: 40px; }
  .hero .texte { position: relative; left: 0; bottom: auto; padding: 120px 28px 0; max-width: none; }
  .defile { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .barre { padding: 12px 16px; gap: 10px; }
  .barre nav, .barre .indep { display: none; }
  .hero .texte { padding: 96px 16px 0; }
  .direct { margin: 20px 16px 0; }
  section.bloc { padding: 64px 16px 10px; }
  .tuiles, .cartes, .maires { grid-template-columns: 1fr; }
  .duel .ligne { grid-template-columns: 1fr; gap: 4px; }
  .fabrique-lien { grid-template-columns: 1fr; }
  footer { padding: 24px 16px 40px; }
}

/* photos libres (Wikimedia Commons) sur les cartes de chantier */
.carte.avec-photo { padding-top: 150px; }
.carte .photo { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 150px; object-fit: cover; filter: saturate(.75) brightness(.8); }
.carte .voile { position: absolute; left: 0; right: 0; top: 0; height: 150px; background: linear-gradient(180deg, rgba(16, 20, 26, 0) 40%, var(--fond-2) 100%); }
.carte .credit { position: absolute; top: 8px; right: 10px; font: 10px var(--mono); color: rgba(233, 228, 216, .75); background: rgba(10, 12, 15, .55); padding: 2px 6px; border-radius: 4px; max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte:hover .photo { filter: saturate(1) brightness(.95); }
