/* ==========================================================
   GREEN PLANET — feuille de styles
   © MicSolutions
   ========================================================== */
:root {
  --forest: #0f3d2e;
  --forest-2: #17543f;
  --leaf: #2e8b57;
  --leaf-2: #3fa86b;
  --lime: #a3d977;
  --ocean: #1e6f9f;
  --sky: #4fb3e0;
  --sand: #f4efe6;
  --clay: #c8743c;
  --sun: #f2b632;
  --danger: #c4453a;

  --bg: #fbfaf6;
  --bg-2: #f4efe6;
  --surface: #ffffff;
  --text: #17231d;
  --muted: #5b6b62;
  --line: #e3ddd0;
  --accent: var(--leaf);
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(15, 61, 46, .06), 0 6px 24px rgba(15, 61, 46, .08);
  --map-sea: #cfe6f2; --map-land: #e9e4d6; --map-africa: #cfe3c3; --map-border: #b9b19c;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --map-sea: #0f2a38; --map-land: #23332b; --map-africa: #2d4a36; --map-border: #3c5246; --bg: #0d1713; --bg-2: #13211b; --surface: #172820; --text: #e8efe9; --muted: #9cb0a5;
    --line: #26392f; --accent: #5cc285; --accent-ink: #0d1713; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --map-sea: #0f2a38; --map-land: #23332b; --map-africa: #2d4a36; --map-border: #3c5246; --bg: #0d1713; --bg-2: #13211b; --surface: #172820; --text: #e8efe9; --muted: #9cb0a5;
  --line: #26392f; --accent: #5cc285; --accent-ink: #0d1713; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.wrap { width: min(1680px, 100% - clamp(32px, 4vw, 80px)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--forest); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 6px; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.35rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--leaf); font-weight: 700; }
.search { position: relative; flex: 1; max-width: 640px; margin-left: auto; }
.search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { width: 100%; height: 42px; padding: 0 40px 0 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.search kbd { position: absolute; right: 12px; top: 50%; translate: 0 -50%; font: 600 .75rem var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.search-results { position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; padding: 6px; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.search-results a:hover, .search-results a.active { background: var(--bg-2); text-decoration: none; }
.search-results .sr-ico { font-size: 1.3rem; width: 28px; text-align: center; }
.search-results .sr-type { margin-left: auto; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.search-results .sr-all { justify-content: center; font-weight: 600; color: var(--accent); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text); flex: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.burger { display: none; }
.nav { border-top: 1px solid var(--line); }
.nav-in { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-in::-webkit-scrollbar { display: none; }
@media (min-width: 1200px) { .nav-in { justify-content: space-between; } }
.nav a { padding: 10px 12px; font-size: .9rem; font-weight: 500; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent); border-color: var(--accent); }

@media (max-width: 860px) {
  .burger { display: grid; }
  .search kbd { display: none; }
  .brand span { display: none; }
  .nav { display: none; }
  .nav.open { display: block; }
  .nav-in { flex-direction: column; padding: 8px 0; }
  .nav a { border-bottom: 0; border-left: 3px solid transparent; }
  .nav a.active { border-left-color: var(--accent); }
}

/* ---------- Layout helpers ---------- */
main { min-height: 70vh; outline: none; }
.section { padding: 56px 0; }
.section.alt { background: var(--bg-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head p { margin: 0; max-width: 680px; }
.eyebrow { display: inline-block; font: 600 .78rem var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
/* Colonnes fixes : les rangées se remplissent sans laisser une carte isolée sur grand écran */
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font: 600 .95rem var(--font); cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.light { background: #fff; color: var(--forest); }
.btn.sm { padding: 7px 12px; font-size: .85rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .85rem; color: var(--text); cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; background: radial-gradient(1200px 600px at 80% 20%, #1f6b4c 0%, transparent 60%), linear-gradient(160deg, #0b2e22 0%, #0f3d2e 45%, #134a6b 100%); }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 72px 0 84px; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero p.lead { font-size: 1.15rem; color: #d8e8de; max-width: 600px; }
.hero .btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.globe { aspect-ratio: 1; width: 100%; max-width: 500px; justify-self: center; position: relative; }
.hero p.lead { max-width: 680px; }
.article { grid-template-columns: minmax(0, 1fr) 360px; }
.article .content { max-width: 900px; }
.globe svg { width: 100%; height: 100%; }
.globe .spin { animation: drift 40s linear infinite; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-200px); } }
@media (prefers-reduced-motion: reduce) { .globe .spin { animation: none; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.12); border-radius: var(--radius); overflow: hidden; margin-top: -40px; position: relative; z-index: 2; box-shadow: var(--shadow); }
.stat { background: var(--surface); padding: 20px; }
.stat b { display: block; font: 700 1.8rem var(--serif); color: var(--forest-2); }
:root[data-theme="dark"] .stat b { color: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat b { color: var(--lime); } }
.stat span { font-size: .86rem; color: var(--muted); }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; padding: 48px 0 72px; }
  .globe { max-width: 260px; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Page hero (rubriques) */
.phero { padding: 52px 0 44px; color: #fff; background: linear-gradient(135deg, var(--c1, #0f3d2e), var(--c2, #2e8b57)); position: relative; overflow: hidden; }
.phero::after { content: attr(data-ico); position: absolute; right: 4%; bottom: -30px; font-size: 180px; opacity: .14; line-height: 1; }
.phero h1 { color: #fff; margin-bottom: .3em; }
.phero p { color: rgba(255,255,255,.86); max-width: 720px; font-size: 1.08rem; margin: 0; }
.crumbs { font-size: .85rem; margin-bottom: 14px; color: rgba(255,255,255,.75); }
.crumbs a { color: #fff; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; color: var(--text); }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.card .media { aspect-ratio: 16/10; background: var(--bg-2) center/cover no-repeat; position: relative; display: grid; place-items: center; font-size: 3rem; }
.card .media .badge { position: absolute; top: 10px; left: 10px; z-index: 1; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .body h3 { margin: 0; font-size: 1.12rem; }
.card .body p { margin: 0; color: var(--muted); font-size: .92rem; }
.card .foot { margin-top: auto; padding-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card .sci { font-style: italic; color: var(--muted); font-size: .88rem; }
.tile { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; gap: 8px; }
a.tile:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.tile .ico { font-size: 2rem; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-2); }
.tile h3 { margin: 4px 0 0; }
.tile p { margin: 0; color: var(--muted); font-size: .93rem; }

/* Statut UICN */
.uicn { display: inline-flex; align-items: center; gap: 6px; font: 700 .72rem var(--font); padding: 3px 9px; border-radius: 999px; color: #fff; letter-spacing: .03em; }
.uicn[data-s="LC"] { background: #2e8b57; } .uicn[data-s="NT"] { background: #7aa83a; }
.uicn[data-s="VU"] { background: #d9a400; color: #1d1d1d; } .uicn[data-s="EN"] { background: #e06a1b; }
.uicn[data-s="CR"] { background: #c4302b; } .uicn[data-s="EW"] { background: #5b2a86; }
.uicn[data-s="EX"] { background: #1d1d1d; } .uicn[data-s="DD"], .uicn[data-s="NE"] { background: #8a8f8c; }
.uicn-scale { display: flex; gap: 4px; flex-wrap: wrap; }
.uicn-scale span { opacity: .3; }
.uicn-scale span.cur { opacity: 1; outline: 2px solid var(--text); outline-offset: 1px; }

/* ---------- Article ---------- */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding: 40px 0 64px; }
.article .content { font-size: 1.05rem; }
.article .content h2 { margin-top: 1.6em; font-size: 1.55rem; }
.article .figure { border-radius: var(--radius); overflow: hidden; margin: 0 0 24px; background: var(--bg-2); }
.article .figure img { width: 100%; max-height: 420px; object-fit: cover; }
.article .figure figcaption { font-size: .8rem; padding: 8px 12px; color: var(--muted); }
.lead-p { font-size: 1.2rem; color: var(--muted); font-family: var(--serif); }
.facts { background: var(--bg-2); border-radius: var(--radius); padding: 20px; border-left: 4px solid var(--accent); }
.facts h3 { font-size: 1.05rem; }
.facts ul { margin: 0; padding-left: 18px; }
.facts li { margin-bottom: 8px; font-size: .95rem; }
.aside { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 130px; align-self: start; }
.aside .box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.aside .box h4 { font-family: var(--font); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.aside .box a.rel { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: var(--text); border-bottom: 1px dashed var(--line); font-size: .94rem; }
.aside .box a.rel:last-child { border: 0; }
.aside .box a.rel span:first-child { font-size: 1.2rem; }
.sources { font-size: .85rem; color: var(--muted); }
.sources li { margin-bottom: 4px; }
.cards-3col { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 12px 0 8px; }
.cause { border-radius: var(--radius-sm); padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.cause h4 { font-family: var(--font); font-size: .95rem; margin-bottom: 6px; }
.cause.c { border-top: 4px solid var(--clay); } .cause.q { border-top: 4px solid var(--danger); } .cause.s { border-top: 4px solid var(--leaf); }
@media (max-width: 960px) { .article { grid-template-columns: 1fr; } .aside { position: static; } }

/* ---------- Species detail ---------- */
.sp-head { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; padding: 36px 0; }
.sp-photo { border-radius: var(--radius); overflow: hidden; background: var(--bg-2); aspect-ratio: 4/3; display: grid; place-items: center; font-size: 6rem; }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; }
.sp-credit { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.dl > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.dl dt { font: 600 .75rem var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.dl dd { margin: 0; }
@media (max-width: 860px) { .sp-head { grid-template-columns: 1fr; } }

/* ---------- Filters / explorer ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 20px; }
.toolbar input[type="search"], .toolbar select, .field input, .field select { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; font-size: .93rem; }
.toolbar input[type="search"] { flex: 1; min-width: 200px; }
.count { font-size: .88rem; color: var(--muted); margin-left: auto; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---------- Map ---------- */
.map-shell { display: grid; grid-template-columns: 300px 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); min-height: 560px; }
.map-side { padding: 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; max-height: 620px; overflow: auto; }
.map-side h4 { font: 600 .76rem var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
#map { min-height: 560px; height: 100%; z-index: 1; }
.map-info { background: var(--bg-2); border-radius: 12px; padding: 14px; font-size: .92rem; }
.map-info h3 { font-size: 1.1rem; margin-bottom: 4px; }
.legend-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.leaflet-popup-content { font: 14px/1.5 var(--font); }
.leaflet-container { background: var(--map-sea); font-family: var(--font); }
path.gp-land { fill: var(--map-land); stroke: var(--map-border); }
path.gp-land.gp-af { fill: var(--map-africa); }
path.gp-land:hover { fill: color-mix(in srgb, var(--map-land) 80%, var(--accent)); }
.leaflet-container .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); }
.gp-marker { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; font-size: 13px; }
@media (max-width: 860px) { .map-shell { grid-template-columns: 1fr; } .map-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; } #map { min-height: 420px; } }

/* ---------- Tools ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tool { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h3 { display: flex; align-items: center; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; gap: 10px; }
.field label output { font-weight: 700; color: var(--accent); white-space: nowrap; }
.field .hint { font-size: .8rem; color: var(--muted); }
.field input[type="range"] { width: 100%; accent-color: var(--leaf); }
.fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.fieldset legend { font: 700 .8rem var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 0; margin: 10px 0 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; font-weight: 500; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 3px solid var(--lime); }
.result { position: sticky; top: 130px; align-self: start; display: flex; flex-direction: column; gap: 16px; }
.big { font: 700 3rem/1 var(--serif); color: var(--accent); }
.big small { font-size: 1rem; color: var(--muted); font-family: var(--font); font-weight: 500; }
.bar { height: 12px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s; }
.cmp-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: .88rem; margin-bottom: 8px; }
.cmp-row b { text-align: right; }
.note { font-size: .82rem; color: var(--muted); background: var(--bg-2); padding: 12px 14px; border-radius: 10px; border-left: 3px solid var(--sun); }
.tips li { margin-bottom: 6px; font-size: .93rem; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; }
@media (max-width: 960px) { .tool { grid-template-columns: 1fr; } .result { position: static; } .cmp-row { grid-template-columns: 110px 1fr 60px; } }

table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); cursor: pointer; white-space: nowrap; }
table.data tr.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.table-scroll { overflow-x: auto; }

/* ---------- Quiz ---------- */
.quiz { max-width: 760px; margin: 0 auto; }
.q-progress { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; margin: 12px 0 20px; }
.q-progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.q-opts { display: grid; gap: 10px; margin: 18px 0; }
.q-opt { text-align: left; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.q-opt:hover:not(:disabled) { border-color: var(--accent); }
.q-opt.ok { border-color: var(--leaf); background: color-mix(in srgb, var(--leaf) 14%, var(--surface)); }
.q-opt.ko { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.q-opt:disabled { cursor: default; }
.q-exp { padding: 14px 16px; border-radius: 12px; background: var(--bg-2); font-size: .95rem; }

/* Challenges */
.ch { position: relative; }
.ch .lvl { font-size: .78rem; font-weight: 700; }
.ch.done { opacity: .6; }
.ch.done h3 { text-decoration: line-through; }
.daily { background: linear-gradient(135deg, #0f3d2e, #2e8b57); color: #fff; border-radius: var(--radius); padding: 28px; display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.daily h3 { color: #fff; font-size: 1.5rem; }
.daily p { color: rgba(255,255,255,.85); margin: 0; }
.daily .ico { font-size: 3.4rem; }
@media (max-width: 700px) { .daily { grid-template-columns: 1fr; } }

/* Encyclopédie A–Z */
.az { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; position: sticky; top: 110px; background: var(--bg); padding: 8px 0; z-index: 5; }
.az a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--text); }
.az a.off { opacity: .3; pointer-events: none; }
.az-group { margin-bottom: 28px; scroll-margin-top: 170px; }
.az-group h3 { font-size: 1.6rem; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.az-list { columns: 3 260px; column-gap: 28px; }
.az-list a { display: block; padding: 4px 0; break-inside: avoid; color: var(--text); }
.az-list a small { color: var(--muted); margin-left: 6px; }
.gloss dt { font-weight: 700; margin-top: 12px; }
.gloss dd { margin: 2px 0 0; color: var(--muted); }

/* Case studies */
.case-flag { font-size: 2.4rem; }
.callout { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.callout .ico { font-size: 2rem; }

.footer { background: #0b2e22; color: #cfe0d6; padding: 48px 0 20px; margin-top: 40px; }
.footer .brand { color: #fff; margin-bottom: 12px; }
.footer .muted { color: #93ab9e; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer h4 { font-family: var(--font); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--lime); }
.footer-in a:not(.brand) { display: block; color: #cfe0d6; padding: 3px 0; font-size: .92rem; }
.copyright { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding-top: 18px; font-size: .86rem; }
@media (max-width: 860px) { .footer-in { grid-template-columns: 1fr 1fr; } .footer-in > div:first-child { grid-column: 1 / -1; } }

.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } html { scroll-behavior: auto; } }

/* ==========================================================
   ANIMATIONS : diaporama d’accueil, bandeaux photo, apparitions
   ========================================================== */
.btn.glass { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); backdrop-filter: blur(8px); }
.btn.glass:hover { background: rgba(255,255,255,.22); }

/* En-tête transparent au-dessus du diaporama */
.topbar { transition: background .35s, border-color .35s, backdrop-filter .35s; }
body.is-home.at-top .topbar { background: transparent; border-color: transparent; backdrop-filter: none; }
body.is-home.at-top .topbar .nav { border-color: rgba(255,255,255,.18); }
body.is-home.at-top .brand, body.is-home.at-top .nav a { color: #fff; }
body.is-home.at-top .nav a:hover { color: var(--lime); }
body.is-home.at-top .nav a.active { color: var(--lime); border-color: var(--lime); }
body.is-home.at-top .search input { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
body.is-home.at-top .search input::placeholder { color: rgba(255,255,255,.75); }
body.is-home.at-top .search svg { stroke: rgba(255,255,255,.8); }
body.is-home.at-top .search kbd { color: #fff; border-color: rgba(255,255,255,.4); }
body.is-home.at-top .icon-btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
body.is-home.at-top .nav.open { background: var(--bg); }
body.is-home.at-top .nav.open a { color: var(--muted); }

/* Diaporama */
.hero.cine { margin-top: calc(-1 * var(--hdr-h, 106px)); padding-top: var(--hdr-h, 106px); min-height: clamp(600px, 94vh, 940px); display: flex; background: #0b2e22; isolation: isolate; }
.cine-slides { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.cine-slide { position: absolute; inset: -2%; background: center / cover no-repeat; opacity: 0; transition: opacity 1.6s ease; will-change: opacity, transform; }
.cine-slide.on { opacity: 1; animation: kenburns calc(var(--dur, 7000ms) + 1800ms) linear both; }
@keyframes kenburns { from { transform: scale(1.03) translate(0, 0); } to { transform: scale(1.15) translate(var(--kx, 0), var(--ky, 0)); } }
.cine-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5,20,14,.55) 0%, rgba(5,20,14,0) 26%),
              linear-gradient(90deg, rgba(5,20,14,.78) 0%, rgba(5,20,14,.35) 48%, rgba(5,20,14,0) 75%),
              linear-gradient(0deg, rgba(5,20,14,.85) 0%, rgba(5,20,14,0) 45%); }
.cine-in { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 36px; padding-block: 48px 92px; min-width: 0; }
.cine-text { max-width: 760px; animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.cine-text h1 { font-size: clamp(2.4rem, 5.6vw, 5rem); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.cine-text h1 em { font-style: normal; color: var(--lime); }
.cine-text .lead { color: rgba(255,255,255,.88); font-size: 1.15rem; }
.cine-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--lime); }
.cine-eyebrow i { width: 34px; height: 2px; background: var(--lime); display: inline-block; }
@keyframes rise { from { transform: translateY(26px); opacity: .001; } to { transform: none; opacity: 1; } }

.cine-nav { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.cine-dot { flex: 1 1 120px; min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; text-align: left; padding: 10px 2px 0; background: none; border: 0; color: rgba(255,255,255,.6); font: 600 .8rem var(--font); cursor: pointer; }
.cine-dot:hover, .cine-dot.on { color: #fff; }
.cine-num { font-variant-numeric: tabular-nums; color: var(--lime); opacity: .8; }
.cine-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cine-bar { grid-column: 1 / -1; height: 3px; background: rgba(255,255,255,.22); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.cine-bar i { display: block; height: 100%; width: 0; background: var(--lime); }
.cine-dot.on .cine-bar i { animation: fillbar var(--dur, 7000ms) linear forwards; }
.cine.paused .cine-dot.on .cine-bar i { animation: none; width: 100%; }
@keyframes fillbar { to { width: 100%; } }
.cine-pause { display: none; flex: none; width: 42px; height: 42px; align-self: end; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; font-size: .8rem; backdrop-filter: blur(6px); }
.cine-credit { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 54px; font-size: .72rem; color: rgba(255,255,255,.6); }

/* Points d’intérêt flottants */
.hotspot { position: absolute; z-index: 2; display: flex; align-items: center; gap: 12px; color: #fff; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .7s .5s, transform .7s .5s; }
.hotspot.on { opacity: 1; pointer-events: auto; transform: none; }
.hotspot:hover { text-decoration: none; }
.hs-dot { position: relative; width: 16px; height: 16px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(163,217,119,.35); flex: none; }
.hs-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--lime); animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(2.8); opacity: 0; } }
.hs-card { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; background: rgba(8,28,20,.55); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: bob 5s ease-in-out infinite; }
.hs-card b { font-size: .98rem; }
.hs-card span { font-size: .8rem; color: rgba(255,255,255,.8); }
.hs-card em { font-style: normal; font-size: .78rem; font-weight: 600; color: var(--lime); margin-top: 2px; }
.hotspot:hover .hs-card { background: rgba(8,28,20,.75); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Bandeaux photo des rubriques */
.phero.has-img { isolation: isolate; padding: 88px 0 72px; }
.phero.has-img::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--c1) 92%, transparent) 0%, color-mix(in srgb, var(--c1) 70%, transparent) 45%, color-mix(in srgb, var(--c2) 25%, transparent) 100%), linear-gradient(0deg, rgba(0,0,0,.35), transparent 60%); }
.phero-bg { position: absolute; inset: -4%; z-index: -2; background: center / cover no-repeat; animation: drift-bg 28s ease-in-out infinite alternate; }
.phero-bg.soft { filter: blur(3px) saturate(1.1); }
.phero.has-img::after { opacity: .1; }
.phero h1 { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.phero p { animation: rise .8s .12s cubic-bezier(.2,.7,.2,1) both; }
@keyframes drift-bg { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.12) translate(-2%, 1%); } }

/* Apparition au défilement (uniquement pour les blocs hors du premier écran) */
.rv { opacity: .001; transform: translateY(28px); }
.rv.in { opacity: 1; transform: none; transition: opacity .7s ease var(--rv-d, 0ms), transform .8s cubic-bezier(.2,.7,.2,1) var(--rv-d, 0ms); }
.tile .ico { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
a.tile:hover .ico { transform: rotate(-6deg) scale(1.08); }
.card .media img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
a.card:hover .media img { transform: scale(1.06); }

@media (max-width: 760px) {
  .hotspot { display: none; }
  .cine-nav .cine-lbl { display: none; }
  .cine-dot { flex: 1 1 30px; }
  .cine-in { padding-block: 32px 80px; }
  .cine-credit { bottom: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .cine-slide.on, .phero-bg, .hs-card, .hs-dot::after, .cine-text, .phero h1, .phero p { animation: none; }
  .rv { opacity: 1; transform: none; }
}
@media (max-width: 760px) {
  .cine-text h1 br { display: none; }
  .cine-shade { background: linear-gradient(180deg, rgba(5,20,14,.6) 0%, rgba(5,20,14,.45) 40%, rgba(5,20,14,.88) 100%); }
  .stat b { font-size: 1.35rem; }
}

/* Barre du diaporama et crédit masqués à la demande : le défilement reste automatique */
.cine-nav, .cine-pause, .cine-credit { display: none !important; }
.cine-in { padding-block: 48px 120px; }
