/* Accueil (index.html) : la page se lit comme le fil de l'app. Chaque section est une slide pleine largeur, avec le
   fond sombre de son thème (background_hex, back/app/themes.py) et une carte question penchée dans la couleur vive
   du thème (color_hex). Les règles communes (en-tête, pied de page, boutons) sont dans styles.css.
   Mobile d'abord : une colonne, puis deux colonnes à partir de 900 px. */
:root { --ease: cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Héros */
.hero { padding: 56px 0 48px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px; align-items: center; }
.hero .wrap > * { min-width: 0; }
.hero h1 { font-size: clamp(38px, 8vw, 76px); letter-spacing: -0.015em; line-height: 1.02; text-wrap: balance; overflow-wrap: anywhere; }
.hero h1 .hl { color: var(--yellow); }
.hero .lead { font-size: 18px; margin-top: 18px; max-width: 52ch; }
.hero .cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.hero .cta span { color: var(--muted); font-size: 13px; }
.themes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.theme { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 13px; font-weight: 700; background: var(--card); border: 1px solid var(--stroke); transition: border-color 0.2s, transform 0.2s var(--ease); }
.theme:hover { border-color: var(--c); transform: translateY(-1px); }
.theme i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.hero h1, .hero .lead, .hero .cta, .hero .themes { animation: rise 0.8s var(--ease) both; }
.hero .lead { animation-delay: 0.1s; }
.hero .cta { animation-delay: 0.2s; }
.hero .themes { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Le fil qui défile tout seul : cinq cartes (la première répétée à la fin), hauteur fixe pour que le défilement tombe juste */
.feed { position: relative; width: 320px; max-width: 100%; height: 520px; margin-inline: auto; }
/* Le dégradé n'estompe que les cartes : la pastille d'XP et l'indication du bas restent en dehors, pleine couleur. */
.feed .view { position: absolute; inset: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent); }
.feed .roll { display: flex; flex-direction: column; gap: 14px; padding-top: 100px; animation: roll 20s var(--ease) infinite; }
.feed .s { flex: none; height: 178px; border-radius: 24px; padding: 18px; background: var(--sb); border: 1px solid rgba(255, 255, 255, 0.06); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); transform: rotate(var(--rot, 0deg)); overflow: hidden; }
.feed .s .chip { display: inline-block; background: var(--sc); color: var(--bg); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; margin-bottom: 10px; }
.feed .s.light .chip { color: var(--text); }
.feed .s p { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.1; }
.feed .s .opt { display: flex; gap: 8px; margin-top: 12px; }
.feed .s .opt span { flex: 1; background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 7px; font-size: 12px; font-weight: 700; text-align: center; }
.feed .s .opt span.on { background: var(--sc); color: var(--bg); }
@keyframes roll { 0%, 16% { transform: translateY(0); } 24%, 41% { transform: translateY(-192px); } 49%, 66% { transform: translateY(-384px); } 74%, 91% { transform: translateY(-576px); } 100% { transform: translateY(-768px); } }
.feed .xp { position: absolute; top: 8px; left: 0; display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--stroke); border-radius: 999px; padding: 6px 12px; font-family: var(--display); font-weight: 800; color: var(--yellow); font-size: 14px; z-index: 3; }
.feed .xp svg { width: 14px; height: 14px; }
.feed .xp em { font-style: normal; color: var(--green); font-size: 12px; animation: pop 5s ease-in-out infinite; }
@keyframes pop { 0%, 8% { opacity: 0; transform: translateY(4px); } 14%, 40% { opacity: 1; transform: none; } 50%, 100% { opacity: 0; transform: translateY(-6px); } }
.feed .sw { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; z-index: 3; display: flex; gap: 6px; align-items: center; }
.feed .sw i { display: inline-block; font-style: normal; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* Slides */
.slide { background: var(--slide-bg); padding: 64px 0; position: relative; overflow: hidden; }
.slide .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: center; }
.slide .wrap > * { min-width: 0; }
.slide .num { position: absolute; right: 16px; top: 18px; font-family: var(--display); font-weight: 800; font-size: 12px; color: rgba(255, 255, 255, 0.35); letter-spacing: 0.08em; text-transform: uppercase; }

/* La carte question penchée, comme dans l'app */
.qcard { background: var(--accent); color: var(--bg); border-radius: var(--r-lg); padding: 22px 22px 26px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45); max-width: 520px; width: 100%; justify-self: center;
  transform: rotate(-7deg) translateY(28px); transition: transform 0.9s var(--ease); }
.in .qcard { transform: rotate(-2deg); }
.in .qcard:hover { transform: rotate(-0.5deg) scale(1.01); }
.qcard .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.qcard .chip { background: rgba(11, 11, 13, 0.14); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
.qcard h2 { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.02; text-wrap: balance; }
.qcard .author { display: flex; align-items: center; gap: 8px; margin-top: 22px; font-size: 13px; font-weight: 800; }
.qcard .author i { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--accent); display: grid; place-items: center; font-style: normal; font-size: 12px; font-family: var(--display); }
.qcard .author em { margin-left: auto; font-style: normal; background: var(--bg); color: var(--text); border-radius: 999px; padding: 5px 11px; font-size: 12px; }
.qcard.light { color: var(--text); }
.qcard.light .chip { background: rgba(255, 255, 255, 0.16); }
.qcard.light .author i { background: var(--text); color: var(--accent); }

.body .lead { max-width: 56ch; }
.answers { display: grid; gap: 10px; margin-top: 24px; }
.ans { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 18px; padding: 14px 16px; min-height: 60px;
  opacity: 0; transform: translateX(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), border-color 0.2s, background 0.2s; }
.in .ans { opacity: 1; transform: none; }
.in .ans:nth-child(2) { transition-delay: 0.1s; }
.in .ans:nth-child(3) { transition-delay: 0.2s; }
.in .ans:nth-child(4) { transition-delay: 0.3s; }
.ans:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.09); }
.ans > i { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--bg); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-style: normal; font-size: 15px; }
.ans > div { min-width: 0; }
.ans b { font-size: 15px; display: block; }
.ans small { display: block; color: var(--text-2); font-size: 13px; line-height: 1.4; }

/* Formats : cinq mini-slides, chacune avec un fond de thème */
.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; margin-top: 22px; }
.fmt { border-radius: var(--r-md); padding: 18px; background: var(--fb); min-height: 170px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.in .fmt { opacity: 1; transform: none; }
.in .fmt:nth-child(2) { transition-delay: 0.08s; }
.in .fmt:nth-child(3) { transition-delay: 0.16s; }
.in .fmt:nth-child(4) { transition-delay: 0.24s; }
.in .fmt:nth-child(5) { transition-delay: 0.32s; }
.in .fmt:hover { transform: translateY(-4px); }
.fmt b { font-family: var(--display); font-size: 19px; font-weight: 800; display: block; margin-bottom: 6px; }
.fmt p { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.fmt .tag { align-self: flex-start; background: var(--fc); color: var(--bg); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; }
.fmt.light .tag { color: var(--text); }

/* Compteurs */
.counters { display: grid; grid-template-columns: 1fr; gap: 12px; }
.counter { border-radius: var(--r-md); padding: 20px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); min-width: 0; }
.counter h3 { font-size: 16px; color: var(--text-2); font-weight: 700; font-family: var(--body); margin-bottom: 8px; }
.counter .big { font-family: var(--display); font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.counter .big svg { width: 24px; height: 24px; }
.counter .big.y { color: var(--yellow); }
.counter p { font-size: 14px; color: var(--text-2); margin-top: 8px; }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); margin-top: 14px; overflow: hidden; }
.bar b { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 4px; transition: width 1.2s var(--ease) 0.2s; }
.in .bar b { width: 62%; }
.zones { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.zones span { border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, 0.1); color: var(--text-2); }
.zones span.on { background: var(--text); color: var(--bg); }

/* FAQ */
.qa details { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 14px 0; }
.qa details:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.qa summary { cursor: pointer; font-weight: 800; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font-family: var(--display); color: var(--accent); font-size: 20px; line-height: 1; transition: transform 0.3s var(--ease); }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa p { color: var(--text-2); font-size: 15px; margin-top: 8px; max-width: 60ch; animation: rise 0.4s var(--ease); }

/* Fin */
.end { text-align: center; padding: 80px 0; }
.end h2 { font-size: clamp(34px, 5vw, 56px); }
.end .lead { margin-top: 12px; }
.end .cta { display: flex; justify-content: center; margin-top: 24px; }

/* Tablette et desktop */
@media (min-width: 640px) {
  .counters { grid-template-columns: 1fr 1fr; }
  .slide { padding: 88px 0; }
  .hero { padding: 72px 0 64px; }
  .slide .num { right: 20px; top: 20px; font-size: 13px; }
  .qcard { padding: 26px 26px 30px; }
}
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr) auto; gap: 48px; }
  .feed { height: 560px; }
  .feed .roll { padding-top: 120px; }
  .slide .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; }
  .slide.flip .wrap { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .slide.flip .qcard { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero .lead, .hero .cta, .hero .themes, .feed .roll, .feed .xp em, .feed .sw i, .qa p { animation: none; }
  .qcard, .ans, .fmt, .bar b, .theme { transition: none; }
  .qcard { transform: rotate(-2deg); }
  .ans, .fmt { opacity: 1; transform: none; }
  .bar b { width: 62%; }
}
