/* Polices hébergées sur le site (Fredoka et Nunito, licence SIL Open Font License) : aucun appel à Google */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("fonts/fredoka-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("fonts/fredoka-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/nunito-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/nunito-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #3b2a3a;
  --ink-soft: #6b5a69;
  --pink: #ff9fb9;
  --pink-deep: #e8456d;
  --cream: #fff8f3;
  --sky: #eaf4ff;
  --card: #ffffff;
  --shadow: 0 4px 0 rgba(59, 42, 58, .18);
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
}

h1, h2, h3, .brand, .btn { font-family: "Fredoka", "Nunito", sans-serif; }

a { color: var(--pink-deep); }

img { max-width: 100%; }

/* ---------- En-tête ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px max(16px, calc((100% - 1120px) / 2));
  background: rgba(255, 248, 243, .92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(59, 42, 58, .08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.top nav { display: flex; gap: 20px; margin-left: auto; }
.top nav a { color: var(--ink-soft); font-weight: 700; text-decoration: none; }
.top nav a:hover { color: var(--pink-deep); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(59, 42, 58, .18); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(59, 42, 58, .18); }
.btn.alt { background: #fff; }
.btn.small { padding: 8px 16px; font-size: 16px; border-radius: 12px; }
.btn .os { font-size: 22px; line-height: 1; }

/* ---------- Accueil ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 16px 72px;
}
.hero h1 { margin: 0 0 16px; font-size: clamp(36px, 5vw, 56px); line-height: 1.08; }
.lead { margin: 0 0 28px; font-size: 20px; color: var(--ink-soft); }
.downloads { display: flex; flex-wrap: wrap; gap: 14px; }
.version { margin: 14px 0 0; font-size: 15px; color: var(--ink-soft); }

.window {
  background: linear-gradient(160deg, #8fb4e8, #b9a6f0);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 rgba(59, 42, 58, .2);
  overflow: hidden;
}
.window-bar { display: flex; gap: 6px; padding: 10px 14px; background: rgba(255, 255, 255, .5); border-bottom: 3px solid var(--ink); }
.window-bar i { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.window-body { position: relative; height: 320px; }
.pet { position: absolute; bottom: 6px; width: 34%; animation: hop 2.6s ease-in-out infinite; }
.pet.p1 { left: 4%; }
.pet.p2 { left: 34%; animation-delay: .5s; width: 32%; }
.pet.p3 { left: 64%; animation-delay: 1s; }
@keyframes hop {
  0%, 70%, 100% { transform: translateY(0); }
  80% { transform: translateY(-18px); }
}
.bubble {
  position: absolute;
  top: 28px;
  left: 8%;
  padding: 8px 14px;
  font-weight: 700;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-6px); } }

/* ---------- Sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 64px 16px; }
.section.tinted {
  max-width: none;
  padding-left: max(16px, calc((100% - 1120px) / 2));
  padding-right: max(16px, calc((100% - 1120px) / 2));
  background: var(--sky);
}
.section h2 { margin: 0 0 12px; font-size: clamp(28px, 3.5vw, 40px); text-align: center; }
.section-lead { margin: 0 auto 32px; max-width: 640px; text-align: center; color: var(--ink-soft); }
.section > h2 + .features, .section > h2 + .moments, .section > h2 + .faq, .section > h2 + .install { margin-top: 32px; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  padding: 22px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.feature-icon { font-size: 36px; line-height: 1; }
.feature h3 { margin: 10px 0 6px; font-size: 21px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 16px; }

.animals { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; }
.animal {
  margin: 0;
  padding: 12px 8px 10px;
  text-align: center;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.animal:hover { transform: translateY(-4px) rotate(-2deg); }
.animal { cursor: pointer; }
.animal img, .animal canvas.live { display: block; width: 100%; aspect-ratio: 180 / 200; object-fit: contain; }
.animal canvas.live { display: none; } /* affiché à la place de l'image dès que le dessin en direct est prêt (animals.js) */
.pet.live { display: none; height: auto; aspect-ratio: 152 / 200; cursor: pointer; }

/* Fêtes : bannière et couleurs d'accent, comme dans l'application (animals.js ajoute la classe fete-…) */
.fete-banner {
  padding: 8px 16px;
  text-align: center;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  background: var(--pink-deep);
}
body.fete-halloween { --pink: #ffb36b; --pink-deep: #d9631e; }
.fete-layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; opacity: .85; }
body.fete-noel { --pink: #f59aa0; --pink-deep: #c42f3c; }
body.fete-magie { --pink: #a9b6ff; --pink-deep: #3b4fb8; }
body.fete-nouvelan { --pink: #ffd36b; --pink-deep: #b8860b; }
body.fete-paques { --pink: #9fe3bd; --pink-deep: #2f9a63; }
body.fete-chat { --pink: #ffc48a; --pink-deep: #d9792b; }
body.fete-chandeleur { --pink: #f6cf7d; --pink-deep: #b97a1c; }
body.fete-poisson { --pink: #9fdcff; --pink-deep: #2a86c4; }
body.fete-musique { --pink: #cdb8ff; --pink-deep: #7a4fd0; }
body.fete-thanksgiving { --pink: #ffb36b; --pink-deep: #b8551e; }
body.fete-stpatrick { --pink: #9fe3bd; --pink-deep: #2f8f52; }
body.fete-pancake { --pink: #f6cf7d; --pink-deep: #b97a1c; }
body.fete-inocentes { --pink: #9fdcff; --pink-deep: #2a86c4; }
.animal figcaption { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; }
.animal figcaption small { display: block; margin-top: 2px; font-family: "Nunito", sans-serif; font-weight: 600; font-size: 12px; line-height: 1.25; color: var(--ink-soft); }
.section-hint { margin: -8px 0 18px; text-align: center; font-size: 15px; color: var(--ink-soft); }

/* Les chats de la maison : une petite fiche pour chacun */
.house-title { margin: 56px 0 6px; text-align: center; font-size: 28px; }
.house-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 860px; margin: 0 auto; }
.house-cat {
  padding: 16px 18px 20px;
  text-align: center;
  background: var(--card);
  border: 3px dashed rgba(59, 42, 58, .35);
  border-radius: var(--radius);
  transition: transform .2s;
}
.house-cat:hover { transform: translateY(-4px) rotate(1.5deg); }
.house-cat img { width: 70%; aspect-ratio: 152 / 160; object-fit: contain; }
.house-cat h4 { margin: 6px 0 4px; font-family: "Fredoka", sans-serif; font-size: 24px; }
.house-cat p { margin: 0; color: var(--ink-soft); font-size: 16px; }

.moments { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.moment {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  background: linear-gradient(170deg, #7fa6dd, #a99be6);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.moment img { display: block; width: 100%; aspect-ratio: 240 / 300; object-fit: cover; }
.moment figcaption { flex: 1; padding: 10px 14px; font-weight: 700; background: var(--card); border-top: 3px solid var(--ink); }

.install { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.install-card {
  padding: 24px 28px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.install-card h3 { margin: 0 0 10px; font-size: 24px; }
.install-card ol { margin: 0; padding-left: 22px; }
.install-card li { margin-bottom: 8px; }
.note { margin: 14px 0 0; padding: 10px 14px; font-size: 15px; background: var(--cream); border-radius: 12px; }
/* Conseils d'installation mis en valeur juste après un clic sur « Télécharger » */
.install-hint { margin: 10px 0 0; font-size: 15px; color: var(--ink-soft); }
.highlight { animation: highlight 1.2s ease 2; }
@keyframes highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 69, 109, 0); }
  50% { box-shadow: 0 0 0 8px rgba(232, 69, 109, .35); }
}

/* Démo jouable : Simba à gauche, ses jauges et les boutons à droite */
.demo { display: flex; align-items: center; justify-content: center; gap: 32px; max-width: 760px; margin: 0 auto; }
.demo-stage {
  position: relative;
  width: 280px;
  flex: none;
  background: linear-gradient(#cfe0ff, #e9dcff);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.demo-stage.drop { outline: 4px dashed var(--pink-deep); outline-offset: 4px; }
.demo-stage canvas { display: block; width: 100%; aspect-ratio: 200 / 220; cursor: pointer; }
.demo-bubble {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  max-width: 90%; padding: 6px 12px;
  background: #fff; border: 2px solid var(--ink); border-radius: 14px;
  font-size: 14px; font-weight: 600; text-align: center;
}
.demo-side { flex: 1; min-width: 220px; }
.demo-stat { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 20px; }
.demo-stat .bar { flex: 1; height: 14px; background: #eee3ea; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.demo-stat .bar i { display: block; height: 100%; background: #6fd39b; transition: width .4s; }
.demo-stat .bar i.mid { background: #ffc94a; }
.demo-stat .bar i.low { background: #ff6f6f; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
/* Choix de l'animal de la démo : une pastille par espèce */
.demo-pick { margin-top: 26px; }
.demo-species { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 760px; margin: 0 auto; }
.demo-species button {
  width: 42px; height: 42px; padding: 0; font-size: 22px; line-height: 1; cursor: pointer;
  background: var(--card); border: 2px solid var(--ink); border-radius: 50%; transition: transform .15s;
}
.demo-species button:hover { transform: scale(1.12); }
.demo-species button.on { background: #ffe1ea; border-color: var(--pink-deep); box-shadow: 0 0 0 3px var(--pink); }
@media (max-width: 640px) { .demo { flex-direction: column; gap: 18px; } .demo-side { width: 100%; } }

/* Nouveautés : une carte par version, les plus anciennes repliées */
.changelog { max-width: 860px; margin: 0 auto; }
.release { margin: 0 0 14px; padding: 16px 22px; background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); }
.release h3 { margin: 0 0 6px; font-size: 20px; }
.release time { margin-left: 8px; font-family: "Nunito", sans-serif; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.release ul { margin: 0; padding-left: 20px; }
.release li { margin: 3px 0; font-size: 15px; }
.older summary { margin: 6px 0 14px; cursor: pointer; font-weight: 700; color: var(--pink-deep); text-align: center; }

/* Encadré : avertissement de macOS et comment le lever */
.mac-warning {
  max-width: 860px;
  margin: 24px auto 0;
  padding: 20px 24px;
  background: #fff8e1;
  border: 3px dashed #e8b84a;
  border-radius: var(--radius);
}
.mac-warning h3 { margin: 0 0 8px; font-size: 22px; }
.mac-warning p { margin: 8px 0; }
.mac-warning ol { margin: 0; padding-left: 22px; }
.mac-warning li { margin-bottom: 6px; }
.mac-warning code { display: inline-block; margin: 2px 0 4px; padding: 8px 12px; font-size: 15px; user-select: all; }
.mac-warning .note { background: #fff; }
code { padding: 2px 6px; font-size: 14px; background: #fff; border: 1px solid rgba(59, 42, 58, .2); border-radius: 6px; word-break: break-all; }

.faq { max-width: 780px; margin: 0 auto; }
.faq details {
  margin-bottom: 12px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.faq summary { padding: 14px 20px; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '＋'; margin-right: 10px; color: var(--pink-deep); }
.faq details[open] summary::before { content: '－'; }
.faq details p { margin: 0; padding: 0 20px 16px 46px; color: var(--ink-soft); }

.bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  font-size: 15px;
  color: var(--ink-soft);
  border-top: 2px solid rgba(59, 42, 58, .08);
}
.bottom p { margin: 0; }

/* Petite pièce du haut de page, vers « Soutenir » : elle se balance au survol */
.coin { display: inline-flex; flex: none; line-height: 0; transition: transform .2s; }
.coin:hover, .coin:focus-visible { transform: rotate(-12deg) scale(1.12); animation: coin-wobble .6s ease-in-out; }
@keyframes coin-wobble {
  0%, 100% { transform: rotate(0) scale(1.12); }
  30% { transform: rotate(-14deg) scale(1.12); }
  60% { transform: rotate(10deg) scale(1.12); }
}

/* Soutenir le projet (don PayPal) */
.soutien-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 32px;
  text-align: center;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.soutien-card h2 { margin-top: 0; }
.soutien-card p { color: var(--ink-soft); line-height: 1.6; }
.soutien-card .btn { margin-top: 6px; }
.soutien-merci { margin: 14px 0 0; font-size: 14px; }

/* Page des mentions légales */
.legal { max-width: 780px; margin: 0 auto; }
.legal h1 { font-size: 36px; margin: 0 0 18px; }
.legal h2 { margin: 28px 0 8px; font-size: 22px; text-align: left; }
.legal p, .legal li { line-height: 1.6; }
.legal .back { margin-top: 32px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 32px; }
  .features, .moments { grid-template-columns: repeat(2, 1fr); }
  .animals { grid-template-columns: repeat(4, 1fr); }
  .install { grid-template-columns: 1fr; }
  .top nav { display: none; }
  .top .btn { margin-left: auto; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .features, .moments { grid-template-columns: 1fr; }
  .animals { grid-template-columns: repeat(3, 1fr); }
  .house-cats { grid-template-columns: 1fr; }
  .house-cat img { width: 50%; }
  .btn { width: 100%; justify-content: center; }
  .top .btn { width: auto; }
  .brand { font-size: 20px; }
  .top { gap: 12px; }
  .window-body { height: 240px; }
}

/* ---------- Choix de la langue ---------- */
.langs { display: flex; gap: 4px; }
.langs a {
  padding: 3px 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 8px;
}
.langs a:hover { color: var(--pink-deep); }
.langs a.on { color: var(--ink); border-color: var(--ink); background: #fff; }
@media (max-width: 900px) { .langs { margin-left: auto; } .top .btn { margin-left: 0; } }
@media (max-width: 520px) { .langs a { padding: 2px 4px; font-size: 12px; } .top .btn.small { display: none; } }

/* Compteur de téléchargements */
.counter { margin: 14px 0 0; font-weight: 700; color: var(--pink-deep); }
.counter + .version { margin-top: 2px; }
