/* Guides gratuits d'Echelia */
@import url("/fonts/fonts.css");
:root {
  --bg: #05060f; --surface: #0e1030; --surface2: #141742; --line: #262a5c; --text: #e8eaff; --muted: #a9acd6;
  --cyan: #5fe7ff; --violet: #b98cff; --gold: #e9c873;
  --sans: "DM Sans", "Segoe UI", system-ui, sans-serif; --display: "Bricolage Grotesque", "DM Sans", sans-serif;
}
[lang="ar"] { --sans: "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif; --display: var(--sans); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  background-image: radial-gradient(1200px 600px at 15% -10%, rgba(58,91,255,.22), transparent 60%), radial-gradient(900px 500px at 110% 10%, rgba(177,77,255,.16), transparent 60%);
  background-attachment: fixed;
  font: 17px/1.7 var(--sans);
}
[lang="ar"] body { line-height: 1.85; }
.wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 64px; }
.narrow { max-width: 760px; margin: 0 auto; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 0 18px; border-bottom: 1px solid var(--line); }
header.top a.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 20px/1 "Bricolage Grotesque", sans-serif; }
header.top img { width: 36px; height: 36px; border-radius: 10px; }
header.top nav { display: flex; gap: 6px; flex-wrap: wrap; }
a { color: var(--cyan); text-underline-offset: 3px; }
strong { color: #fff; }
.crumb { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.crumb a { color: var(--muted); }
.kicker { display: inline-block; margin: 22px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
[lang="ar"] .kicker, [lang="ar"] .label { letter-spacing: 0; }
h1 { font: 800 clamp(30px, 6.4vw, 46px)/1.1 var(--display); margin: 8px 0 12px; letter-spacing: -.015em; text-wrap: balance; }
[lang="ar"] h1, [lang="ar"] h2 { letter-spacing: 0; line-height: 1.35; }
.lead { font-size: 19px; color: #d6d9ff; margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
h2 { font: 700 23px/1.25 var(--display); margin: 36px 0 10px; color: #fff; }
p { margin: 10px 0; }
.why { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px; }
ol.steps { list-style: none; padding: 0; margin: 12px 0; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding-inline-start: 52px; margin: 0 0 18px; }
ol.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 2px; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font: 800 16px/1 "Bricolage Grotesque", sans-serif; color: #021018; background: linear-gradient(135deg, var(--cyan), var(--violet)); }
ol.steps b { display: block; color: #fff; font-size: 18px; }
ol.steps p { margin: 4px 0 0; color: var(--text); }
.prompt { background: var(--surface2); border: 1px solid var(--line); border-radius: 18px; margin: 14px 0; overflow: hidden; }
.prompt .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prompt .ph b { color: var(--gold); font-size: 15px; }
.prompt pre { margin: 0; padding: 14px 16px; white-space: pre-wrap; word-wrap: break-word; font: 15.5px/1.6 var(--sans); color: #f2f3ff; }
ul.bad, ul.ok { list-style: none; padding: 0; margin: 10px 0; }
ul.bad li { position: relative; padding-inline-start: 30px; margin: 8px 0; }
ul.bad li::before { content: "✕"; position: absolute; inset-inline-start: 4px; color: #ff8fa3; font-weight: 700; }
.cta-card { margin: 40px 0 0; padding: 22px; border-radius: 22px; background: linear-gradient(135deg, rgba(95,231,255,.14), rgba(185,140,255,.14)); border: 1px solid var(--line); }
.cta-card h2 { margin: 0 0 6px; }
.btn { display: inline-block; margin-top: 10px; background: var(--cyan); color: #021018; font-weight: 700; text-decoration: none; padding: 12px 18px; border-radius: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.card { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; transition: border-color .2s ease; }
.card b { display: block; color: #fff; font-size: 17px; line-height: 1.35; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 15px; line-height: 1.5; display: block; }
@media (hover: hover) and (pointer: fine) { .card:hover { border-color: var(--cyan); } }
.hero { text-align: center; padding: 26px 0 8px; }
.hero .lead { max-width: 40ch; margin: 0 auto; }
.search { display: block; width: 100%; max-width: 560px; margin: 20px auto 10px; font: 16px/1.4 var(--sans); padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.search:focus { outline: 2px solid var(--cyan); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.chip { font: 600 14px/1 var(--sans); background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; cursor: pointer; min-height: 40px; }
.chip[aria-pressed="true"] { color: #021018; background: var(--cyan); border-color: var(--cyan); }
.theme-sec[hidden], .card[hidden] { display: none; }
.empty { text-align: center; color: var(--muted); }
footer { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer a { color: var(--muted); }
footer p { flex-basis: 100%; margin: 4px 0; }
@media print { .mock-bar, .share, .pager, .acts { display: none !important; }
  body { background: #fff; color: #000; } header.top nav, .copy, .cta-card, footer { display: none; } .prompt, .why { background: #fff; } .prompt pre, p, li, strong, ol.steps b { color: #000; } }

/* ---------- v2 : boutons, illustrations, exemples ---------- */
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nb { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 15px/1.2 var(--sans); text-decoration: none; color: var(--cyan); background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 9px 13px; min-height: 44px; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, border-color 200ms ease; -webkit-tap-highlight-color: transparent; }
.nb:active, .btn:active, .card:active, .chip:active { transform: scale(0.97); }
.nb.cta, .nb.copy { background: var(--cyan); color: #021018; }
.nb.ghost { border-color: var(--line); color: var(--text); background: rgba(14,16,48,.6); }
.nb.done { background: #6cf2b0; color: #04210f; border-color: #6cf2b0; }
.btn { transition: transform 160ms var(--ease-out); }
.chip { transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, border-color 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .nb.ghost:hover { border-color: var(--cyan); }
  .nb.cta:hover, .nb.copy:hover, .btn:hover { background: #8ff0ff; }
  .chip:hover { border-color: var(--cyan); color: #fff; }
}
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.pill.full { color: #04210f; background: #6cf2b0; border-color: #6cf2b0; }
.metarow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; }
.art { display: block; flex-shrink: 0; border-radius: 18px; }
.art.big { width: 120px; height: 84px; box-shadow: 0 10px 30px -12px rgba(95,231,255,.45); }
.ghero { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.ghero h1 { margin-top: 4px; }
.ghero .kicker { margin-top: 0; }
@media (max-width: 560px) { .ghero { flex-direction: column; align-items: flex-start; gap: 12px; } .art.big { width: 96px; height: 67px; } }
.em { display: inline-block; }
.hero-art { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.hero-art .art { border-radius: 12px; }
.sec-head { display: flex; align-items: center; gap: 14px; margin: 34px 0 8px; }
.sec-head h2 { margin: 0; }
.sec-head .art { border-radius: 14px; }
.card { position: relative; transition: border-color .2s ease, transform 160ms var(--ease-out); }
.card .cem { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); font-size: 21px; margin-bottom: 10px; }
.prompt .ph { flex-wrap: wrap; }
.prompt .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.prompt .nb { min-height: 40px; padding: 8px 12px; font-size: 14px; }
/* Exemple : capture de conversation */
.mock { margin: 14px 0 6px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #0a0c24; box-shadow: 0 18px 40px -24px rgba(0,0,0,.8); }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface2); border-bottom: 1px solid var(--line); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2c3170; }
.mock-bar i:first-child { background: #ff6b8b; } .mock-bar i:nth-child(2) { background: #ffc857; } .mock-bar i:nth-child(3) { background: #6cf2b0; }
.mock-bar span { margin-inline-start: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 88%; border-radius: 16px; padding: 10px 14px; }
.msg p { margin: 2px 0 0; white-space: pre-line; font-size: 15px; line-height: 1.6; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--muted); }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, rgba(95,231,255,.22), rgba(58,91,255,.22)); border: 1px solid rgba(95,231,255,.35); border-end-end-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-end-start-radius: 6px; }
.msg.ai .dot { color: var(--gold); }
.mock figcaption { padding: 0 16px 14px; font-size: 13px; color: var(--muted); }
/* Checklist cochable */
.chk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
ul.ok li { margin: 8px 0; }
ul.ok label { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color 200ms ease, transform 160ms var(--ease-out); }
ul.ok label:active { transform: scale(0.99); }
ul.ok input { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 24px; height: 24px; margin: 2px 0 0; border-radius: 8px; border: 2px solid var(--line); background: var(--bg); display: grid; place-items: center; transition: background-color 160ms ease, border-color 160ms ease; cursor: pointer; }
ul.ok input::after { content: "✓"; color: #04210f; font-weight: 800; font-size: 15px; opacity: 0; transform: scale(0.8); transition: opacity 160ms ease, transform 160ms var(--ease-out); }
ul.ok input:checked { background: #6cf2b0; border-color: #6cf2b0; }
ul.ok input:checked::after { opacity: 1; transform: scale(1); }
ul.ok input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
ul.ok input:checked + span { color: var(--muted); }
/* Précédent / suivant */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 34px 0 0; }
.pager .nb { flex-direction: column; align-items: flex-start; justify-content: center; text-align: start; padding: 12px 14px; min-height: 64px; }
.pager .nb.next { align-items: flex-end; text-align: end; }
.pager small { color: var(--cyan); font-size: 13px; }
@media (max-width: 520px) { .pager { grid-template-columns: 1fr; } .pager .nb.next { align-items: flex-start; text-align: start; } }
/* Entrée en cascade des cartes (une fois, au chargement) */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.grid .card { animation: rise 300ms var(--ease-out) both; }
.grid .card:nth-child(2) { animation-delay: 40ms; } .grid .card:nth-child(3) { animation-delay: 80ms; } .grid .card:nth-child(4) { animation-delay: 120ms; } .grid .card:nth-child(5) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  .grid .card { animation: none; }
  .nb, .btn, .chip, .card, ul.ok label, ul.ok input::after { transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, opacity 150ms ease; }
  .nb:active, .btn:active, .card:active, .chip:active, ul.ok label:active { transform: none; }
}
