/* Les jeux de Yaya : site de téléchargement.
   Même direction artistique que l'appli : ciel, collines, police Fredoka, boutons bonbon. */
@font-face {
  font-family: 'Fredoka';
  src: url(fonts/fredoka.woff2) format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #3a2e5a;
  --ink-soft: #6b6385;
  --pink: #ff5d8f;
  --yellow: #ffb703;
  --green: #4cc9a0;
  --blue: #4cc9f0;
  --violet: #9b5de5;
  --sky1: #8fd3ff;
  --sky2: #c4ebff;
  --sky3: #e9f9ff;
  --grass: #7ccf5a;
  --grass-light: #a7e07c;
  --cream: #fff9ef;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- Bulles de fond */
.bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bubbles span {
  position: absolute;
  bottom: -120px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .95) 0 12%, var(--c) 13% 70%, rgba(255, 255, 255, .4) 100%);
  opacity: .35;
  animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translate(0, 0); }
  50% { transform: translate(30px, -55vh); }
  100% { transform: translate(-10px, -115vh); }
}

/* ---------------------------------------------------------------- Haut de page */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 7vh 6vw 22vh;
  display: flex;
  align-items: center;
  background: linear-gradient(var(--sky1) 0%, var(--sky2) 55%, var(--sky3) 100%);
  overflow: hidden;
}
.sky { position: absolute; inset: 0; pointer-events: none; }
.sun {
  position: absolute;
  right: 6vw;
  top: 6vh;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #ffd23f;
  box-shadow: 0 0 0 22px rgba(255, 210, 63, .3), 0 0 0 46px rgba(255, 210, 63, .14);
  animation: sun 5s ease-in-out infinite;
}
@keyframes sun { 50% { transform: scale(1.08); } }
.cloud {
  position: absolute;
  left: 0;
  width: 170px;
  height: 54px;
  border-radius: 54px;
  background: #fff;
  opacity: .92;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; border-radius: 50%; background: #fff; }
.cloud::before { width: 70px; height: 70px; left: 26px; top: -34px; }
.cloud::after { width: 92px; height: 92px; left: 66px; top: -50px; }
.c1 { top: 16vh; animation-duration: 60s; animation-delay: -12s; }
.c2 { top: 46vh; --s: .6; animation-duration: 85s; animation-delay: -50s; opacity: .7; }
.c3 { top: 7vh; --s: .8; animation-duration: 72s; animation-delay: -36s; }
@keyframes drift {
  from { transform: translateX(-220px) scale(var(--s, 1)); }
  to { transform: translateX(calc(100vw + 40px)) scale(var(--s, 1)); }
}
.hills {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 26vh;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: 4vw;
}
.kicker {
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: -6px;
  padding-left: 6px;
}
.name {
  display: flex;
  gap: 4px;
  font-size: clamp(96px, 13vw, 190px);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.name span {
  display: inline-block;
  color: var(--c);
  text-shadow:
    5px 0 #fff, -5px 0 #fff, 0 5px #fff, 0 -5px #fff,
    4px 4px #fff, -4px 4px #fff, 4px -4px #fff, -4px -4px #fff,
    0 12px 0 rgba(58, 46, 90, .16);
  animation: wave 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -.3s);
}
.name span.pop { animation: pop .5s ease-out; }
@keyframes wave {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}
@keyframes pop {
  40% { transform: scale(1.3) translateY(-16px); }
}
.tagline {
  margin: 18px 0 30px;
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 30em;
}

/* Bouton bonbon */
.candy {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 18px 34px 22px 22px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  text-decoration: none;
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, .14),
    inset 0 6px 0 rgba(255, 255, 255, .3),
    0 10px 0 rgba(58, 46, 90, .16),
    0 18px 40px rgba(255, 93, 143, .35);
  transition: transform .15s ease;
  animation: wiggle 5s ease-in-out infinite;
}
.candy:hover { transform: translateY(-3px) scale(1.03); }
.candy:active { transform: translateY(4px) scale(.97); }
.candy strong { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.candy small { display: block; font-size: 16px; opacity: .9; }
.candy-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  display: grid;
  place-items: center;
  font-size: 30px;
}
@keyframes wiggle {
  0%, 88%, 100% { rotate: 0deg; }
  91% { rotate: -3deg; }
  94% { rotate: 3deg; }
  97% { rotate: -1.5deg; }
}
.meta { margin-top: 22px; font-size: 16px; color: var(--ink-soft); }
.meta a { font-weight: 600; }

/* Tablette */
.hero-device { position: relative; }
.tablet {
  position: relative;
  padding: 16px;
  border-radius: 34px;
  background: #2d2a4a;
  box-shadow:
    inset 0 0 0 3px #47426e,
    0 14px 0 rgba(58, 46, 90, .18),
    0 30px 60px rgba(58, 46, 90, .25);
}
.tablet img, .tablet .slides { border-radius: 18px; overflow: hidden; }
.tablet::after { /* petite caméra */
  content: '';
  position: absolute;
  top: 50%;
  right: 6px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #5b5585;
}
.tilt { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-1deg) translateY(-14px); }
}
.sticker {
  position: absolute;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 46px;
  box-shadow: 0 8px 0 rgba(58, 46, 90, .14);
  animation: bob 4s ease-in-out infinite;
}
.s1 { left: -30px; top: -26px; }
.s2 { right: -18px; top: 30%; animation-delay: -1.3s; }
.s3 { left: 12%; bottom: -40px; animation-delay: -2.6s; }
@keyframes bob { 50% { transform: translateY(-14px) rotate(8deg); } }

/* ---------------------------------------------------------------- Sections */
main { position: relative; z-index: 1; }
.section { padding: 90px 6vw; }
.title {
  text-align: center;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 700;
  line-height: 1.1;
}
.lead {
  text-align: center;
  margin: 14px auto 0;
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 34em;
}

/* Jeux */
.games { background: var(--grass); color: #fff; padding-top: 40px; }
.games .title { text-shadow: 0 5px 0 rgba(0, 0, 0, .1); }
.games .lead { color: rgba(255, 255, 255, .92); }
.cards {
  max-width: 1150px;
  margin: 50px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.card {
  position: relative;
  padding: 30px 28px 32px;
  border-radius: 34px;
  background: var(--c);
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, .1),
    inset 0 8px 0 rgba(255, 255, 255, .28),
    0 10px 0 rgba(58, 46, 90, .15);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.card:hover { transform: translateY(-8px) rotate(-1.5deg); }
.card:nth-child(even):hover { transform: translateY(-8px) rotate(1.5deg); }
.card:hover .card-icon { animation: jelly .6s ease; }
.card-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  display: grid;
  place-items: center;
  font-size: 56px;
  margin-bottom: 16px;
}
@keyframes jelly {
  30% { transform: scale(1.25, .8); }
  50% { transform: scale(.85, 1.2); }
  70% { transform: scale(1.08, .95); }
}
.card h3 { font-size: 30px; font-weight: 700; text-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.card p { margin-top: 8px; font-size: 18px; line-height: 1.5; color: rgba(255, 255, 255, .95); }

/* Galerie */
.gallery { background: var(--sky3); }
.viewer {
  position: relative;
  max-width: 920px;
  margin: 50px auto 0;
}
.tablet.big { padding: 20px; border-radius: 40px; }
.slides { position: relative; aspect-ratio: 16 / 10; background: #fff; }
.slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .6s ease, transform .8s ease;
}
.slides img.on { opacity: 1; transform: scale(1); }
.nav {
  position: absolute;
  top: 50%;
  width: 64px;
  height: 64px;
  margin-top: -32px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(58, 46, 90, .16);
  transition: transform .15s;
}
.nav:hover { transform: scale(1.1); }
.nav:active { transform: scale(.92); }
.prev { left: -30px; }
.next { right: -30px; }
.caption { text-align: center; margin-top: 26px; font-size: 26px; font-weight: 600; }
.dots { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.dots button {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: #c9c2e3;
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.dots button.on { background: var(--pink); transform: scale(1.35); }

/* Parents */
.parents { background: var(--cream); }
.features {
  max-width: 1100px;
  margin: 50px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature {
  padding: 26px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 8px 0 rgba(58, 46, 90, .08), 0 18px 40px rgba(58, 46, 90, .06);
}
.feature span {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  background: #fff1d6;
  font-size: 34px;
  margin-bottom: 12px;
}
.feature:nth-child(2) span { background: #ffe0ea; }
.feature:nth-child(3) span { background: #dff6ff; }
.feature:nth-child(4) span { background: #e9e2ff; }
.feature:nth-child(5) span { background: #dcf7ea; }
.feature h3 { font-size: 22px; font-weight: 700; }
.feature p { margin-top: 6px; font-size: 17px; line-height: 1.5; color: var(--ink-soft); }

/* Installation */
.install { background: linear-gradient(var(--cream), #ffeef4); text-align: center; }
.steps {
  list-style: none;
  max-width: 1050px;
  margin: 50px auto 46px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  text-align: left;
}
.step {
  position: relative;
  padding: 58px 26px 28px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 8px 0 rgba(58, 46, 90, .08);
}
.step b {
  position: absolute;
  top: -30px;
  left: 26px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 32px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12), 0 6px 0 rgba(58, 46, 90, .14);
}
.step h3 { font-size: 24px; font-weight: 700; }
.step p { margin-top: 6px; font-size: 17px; line-height: 1.5; color: var(--ink-soft); }
.candy.small { padding: 14px 30px 18px 16px; }
.candy.small strong { font-size: 22px; }
.candy.small .candy-icon { width: 46px; height: 46px; font-size: 24px; }

/* Bas de page */
.footer {
  position: relative;
  z-index: 1;
  padding: 90px 6vw 36px;
  text-align: center;
  background: var(--grass);
  color: #fff;
  font-size: 18px;
  overflow: hidden;
}
.footer::before { /* une colline qui déborde */
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  top: -60px;
  height: 120px;
  border-radius: 50%;
  background: var(--grass-light);
}
.footer p { position: relative; }
.footer a { font-weight: 700; }
.parade {
  position: absolute;
  left: 0;
  top: 22px;
  display: flex;
  gap: 28px;
  font-size: 40px;
  animation: parade 26s linear infinite;
}
.parade span { display: inline-block; animation: hop .5s ease-in-out infinite alternate; }
.parade span:nth-child(odd) { animation-delay: -.25s; }
@keyframes parade {
  from { transform: translateX(-420px); }
  to { transform: translateX(100vw); }
}
@keyframes hop { to { transform: translateY(-10px); } }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .6s ease, transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.reveal.seen { opacity: 1; transform: none; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ---------------------------------------------------------------- Petits écrans */
@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .name { justify-content: center; }
  .tagline { margin-left: auto; margin-right: auto; }
  .hero-device { max-width: 560px; margin: 20px auto 0; width: 100%; }
  .cards, .features, .steps { grid-template-columns: 1fr 1fr; }
  .steps { gap: 50px 26px; }
  .sun { width: 80px; height: 80px; }
  .prev { left: -12px; }
  .next { right: -12px; }
}
@media (max-width: 600px) {
  .section { padding: 70px 18px; }
  .hero { padding: 30px 18px 18vh; }
  .cards, .features, .steps { grid-template-columns: 1fr; }
  .candy { padding: 14px 26px 18px 14px; }
  .candy strong { font-size: 22px; }
  .sticker { width: 64px; height: 64px; font-size: 32px; }
  .s1 { left: -8px; }
  .s2 { right: -6px; }
  .nav { width: 48px; height: 48px; margin-top: -24px; font-size: 16px; }
  .prev { left: -8px; }
  .next { right: -8px; }
}

/* Moins d'animations pour qui le demande */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .slides img.on { transform: none; }
}
