:root {
  --bg: #f6f7fc;
  --card: #ffffff;
  --text: #10172e;
  --muted: #5f6a8a;
  --line: #e2e7f2;
  --accent: #4f6bff;
  --accent-2: #8b5cf6;
  --soft: #eef1ff;
  --dark: #0b1020;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --card: #131a2f;
    --text: #e9edf9;
    --muted: #9ba5c6;
    --line: #232b45;
    --soft: #1a2240;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { display: block; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; }

/* ---------- navigation */
.nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 14px max(16px, calc((100% - 1160px) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 20px; }
.logo b { color: var(--accent-2); }
.links { display: flex; gap: 22px; margin-left: auto; }
.links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.links a:hover { color: var(--text); }
@media (max-width: 720px) { .links { display: none; } .nav .btn { margin-left: auto; } }

/* ---------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 22px; border-radius: 16px; border: 0;
  font: 700 16px/1.2 inherit; text-decoration: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 34px rgba(79, 107, 255, .35);
}
.btn-primary:hover { box-shadow: 0 16px 44px rgba(79, 107, 255, .45); transform: translateY(-1px); }
.btn-primary svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.btn-primary span { display: grid; text-align: left; }
.btn-primary small { font-weight: 500; font-size: 12px; opacity: .85; }
.btn-ghost { color: var(--text); background: var(--card); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-light { color: var(--dark); background: #fff; }

/* ---------- héros */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
  max-width: 1160px; margin: 0 auto; padding: 72px 16px 56px;
}
.eyebrow {
  display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px;
  background: var(--soft); color: var(--accent); font-weight: 700; font-size: 14px;
}
h1 { font-size: clamp(40px, 6vw, 68px); font-weight: 800; }
.grad { background: linear-gradient(135deg, var(--accent), var(--accent-2) 60%, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--muted); max-width: 560px; margin: 20px 0 30px; }
.lead strong { color: var(--text); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.cta.center { justify-content: center; }
.note { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 36px; }
  .cta .btn { width: 100%; }
}

/* maquette du téléphone */
.hero-visual { position: relative; display: grid; place-items: center; min-height: 560px; }
.glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, .35), transparent 65%); filter: blur(10px); }
.phone {
  position: relative; width: 290px; height: 590px; border-radius: 46px; padding: 12px;
  background: #0d1222; box-shadow: 0 40px 80px rgba(15, 23, 60, .35), inset 0 0 0 2px #2a3150;
  transform: rotate(-3deg);
}
.notch { position: absolute; top: 18px; left: 50%; width: 92px; height: 26px; margin-left: -46px; border-radius: 20px; background: #000; z-index: 2; }
.screen { height: 100%; border-radius: 36px; overflow: hidden; background: #f4f6fb; padding: 54px 12px 12px; display: grid; align-content: start; gap: 12px; color: #121a2e; font-size: 12px; }
.s-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.s-me { font-weight: 600; color: #16a34a; font-size: 10px; background: #fff; padding: 3px 8px; border-radius: 999px; }
.s-card { position: relative; overflow: hidden; background: #fff; border-radius: 18px; padding: 14px; border: 1px solid #e3e8f2; }
.s-title { margin: 0; font-weight: 700; font-size: 13px; }
.radar i { position: absolute; left: 50%; top: 62%; width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%; border: 1.5px solid rgba(79, 107, 255, .35); animation: ping 4.5s ease-out infinite; opacity: 0; }
.radar i:nth-child(2) { animation-delay: 1.5s; }
.radar i:nth-child(3) { animation-delay: 3s; }
@keyframes ping { 0% { transform: scale(.15); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.s-peers { position: relative; display: flex; justify-content: space-around; padding: 18px 0 6px; }
.s-peer { display: grid; justify-items: center; gap: 6px; font-size: 10px; }
.av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; box-shadow: 0 6px 16px rgba(40, 50, 120, .25); }
.av.big { width: 58px; height: 58px; font-size: 26px; margin: 0 auto 8px; }
.a1 { background: linear-gradient(135deg, #34d399, #22c55e); }
.a2 { background: linear-gradient(135deg, #f472b6, #a855f7); }
.a3 { background: linear-gradient(135deg, #60a5fa, #4f46e5); }
.s-dialog {
  background: #fff; border-radius: 20px; padding: 18px 14px 14px; text-align: center;
  box-shadow: 0 18px 40px rgba(20, 30, 70, .22); animation: pop 3.2s ease-in-out infinite alternate;
}
.s-dialog p { margin: 0; font-size: 13px; line-height: 1.35; }
.s-dialog small { color: #64708f; }
.s-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.s-actions span { padding: 9px 0; border-radius: 12px; background: #eef1ff; font-weight: 700; }
.s-actions .ok { color: #fff; background: linear-gradient(135deg, #4f6bff, #8b5cf6); }
@keyframes pop { from { transform: translateY(4px); } to { transform: translateY(-4px); } }
.float {
  position: absolute; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 16px;
  background: var(--card); color: var(--text); font-weight: 700; font-size: 14px; border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(20, 30, 70, .16); animation: drift 6s ease-in-out infinite;
}
.float em { font-style: normal; color: #16a34a; font-size: 12px; }
.float .bar { width: 70px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.float .bar i { display: block; height: 100%; width: 64%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: load 3s ease-in-out infinite; }
.f1 { top: 60px; left: 0; }
.f2 { bottom: 110px; right: -6px; animation-delay: -2s; }
.f3 { bottom: 30px; left: 12px; animation-delay: -4s; }
@keyframes drift { 50% { transform: translateY(-10px); } }
@keyframes load { from { width: 10%; } to { width: 100%; } }
@media (max-width: 520px) { .f1 { left: -4px; } .f2 { right: -4px; } .hero-visual { min-height: 520px; } .phone { transform: scale(.92) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .radar i, .s-dialog, .float, .float .bar i { animation: none; } }

/* ---------- appareils */
.devices { max-width: 1160px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; color: var(--muted); }
.devices p { margin: 0 0 12px; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.devices ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.devices li { padding: 8px 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 700; color: var(--text); }

/* ---------- sections */
.section { max-width: 1160px; margin: 0 auto; padding: 72px 16px; }
.section.alt { max-width: none; background: var(--card); border-block: 1px solid var(--line); }
.section.alt > * { max-width: 1128px; margin-left: auto; margin-right: auto; }
.section h2 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; text-align: center; }
.section-lead { text-align: center; color: var(--muted); font-size: 18px; margin: 12px 0 0; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px; transition: transform .2s, box-shadow .2s; }
.feat:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(20, 30, 70, .1); }
.ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--soft); font-size: 26px; }
.feat h3 { font-size: 19px; margin: 18px 0 8px; }
.feat p { margin: 0; color: var(--muted); }

.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 44px; counter-reset: s; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.steps li { position: relative; padding: 28px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line); }
.num {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; margin-bottom: 18px;
  color: #fff; font-weight: 800; font-size: 20px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.steps h3 { font-size: 19px; margin-bottom: 8px; }
.steps p { margin: 0; color: var(--muted); }

.versions { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 44px; }
@media (max-width: 820px) { .versions { grid-template-columns: 1fr; } }
.version { position: relative; display: grid; gap: 16px; align-content: start; padding: 32px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); }
.version.main { border: 2px solid transparent; background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--accent), var(--accent-2)) border-box; }
.version h3 { font-size: 24px; }
.version ul { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.version ul b { color: var(--text); }
.version .btn { margin-top: 8px; align-self: end; }
.tag { position: absolute; top: -13px; right: 24px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.faq { display: grid; gap: 12px; max-width: 780px !important; margin-top: 40px !important; }
.faq details { border-radius: 18px; background: var(--bg); border: 1px solid var(--line); padding: 4px 22px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 24px; line-height: 1; color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 18px; color: var(--muted); }

.final {
  margin: 72px auto; max-width: 1128px; padding: 64px 24px; border-radius: 32px; text-align: center; color: #fff;
  background: radial-gradient(circle at 20% 0%, rgba(236, 72, 153, .45), transparent 50%), linear-gradient(135deg, var(--accent), var(--accent-2));
}
.final h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 28px; }
.final .btn-primary { background: var(--dark); box-shadow: none; }
@media (max-width: 1160px) { .final { margin: 56px 16px; } }

.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: 1160px; margin: 0 auto; padding: 28px 16px 40px; color: var(--muted); font-size: 14px; }
.footer .logo { font-size: 17px; }
.footer p { margin: 0; }

/* ---------- icônes Phosphor (/icons, licence MIT) */
.pi {
  display: inline-block; width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em;
  background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.ic { color: var(--accent); }
.ic .pi { width: 30px; height: 30px; }
.av { color: #fff; }
.av .pi { width: 24px; height: 24px; }
.av.big .pi { width: 30px; height: 30px; }
.float .pi { width: 20px; height: 20px; color: var(--accent); }
.float em .pi { width: 16px; height: 16px; color: #16a34a; }
.version h3 { display: flex; align-items: center; gap: 10px; }
.version h3 .pi { color: var(--accent); width: 28px; height: 28px; }
.eyebrow .pi, .s-logo .pi { color: inherit; }

/* Logo dans les boutons « Accéder à ChapChap » */
.btn-logo { width: 24px; height: 24px; border-radius: 7px; flex: none; }
.btn.small .btn-logo { width: 20px; height: 20px; border-radius: 6px; }
@media (max-width: 480px) { .nav .hide-xs { display: none; } }

/* ---------- Bouton mis en avant selon l'appareil
   Ordinateur : « Télécharger pour Windows » en violet (par défaut).
   Téléphone  : « Accéder à ChapChap » en violet et en premier ; le téléchargement passe au second plan. */
.is-mobile .cta-access {
  color: #fff; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 34px rgba(79, 107, 255, .35);
}
.is-mobile .cta-access .btn-logo { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.is-mobile .cta-download { color: var(--text); background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.is-mobile .hero .cta .cta-access { order: -1; }
.is-mobile .final .cta-access { order: -1; background: var(--dark); box-shadow: none; }
.is-mobile .final .cta-download { background: #fff; color: var(--dark); border: 0; }
.is-mobile .version.main .cta-download { color: var(--text); }
