/* ==========================================================================
   Kikicri : « la basse-cour qui crie ».
   Ciel d'été, ondes sonores claires qui partent de la boîte, cris des
   animaux qui sortent tour à tour en bulles, barrière de bois, carnet du fermier.
   L'illustration de la boîte est affichée entière, sans aucun effet.
   ========================================================================== */

.kc {
  --ciel-kc: #bfe6f5;
  --herbe-kc: #6fae3e;
  --herbe-fonce: #3f7a22;
  --rouge-kc: #a8332a;
  --rouge-fonce-kc: #6e1f19;
  --creme-kc: #fff8e6;
  --encre-kc: #1d2a22;
  --doux-kc: #3c4d42;
  --bois-kc: #9a6a3c;
  background: var(--creme-kc);
  color: var(--encre-kc);
}
.kc .fil-ariane, .kc .fil-ariane a { color: #24414d; }

/* ---------- La cour de ferme (ouverture) ---------- */
.kc-ferme {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: 5.5rem;
  background: linear-gradient(180deg, var(--ciel-kc) 0 62%, #d7efc4 62%, var(--herbe-kc) 100%);
}
.kc-ciel { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.kc-soleil {
  position: absolute; top: 2.2rem; right: 8%;
  width: 5.5rem; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #ffe68a 0 55%, #ffd34d 56% 62%, rgba(255, 211, 77, 0) 63%);
  box-shadow: 0 0 0 1.2rem rgba(255, 226, 120, 0.25), 0 0 0 2.6rem rgba(255, 226, 120, 0.12);
}
.kc-nuage {
  position: absolute; height: 2.4rem; width: 8rem; border-radius: 2rem; background: #fff;
  opacity: 0.92;
}
.kc-nuage::before, .kc-nuage::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.kc-nuage::before { width: 3.4rem; height: 3.4rem; left: 1.2rem; top: -1.6rem; }
.kc-nuage::after { width: 2.6rem; height: 2.6rem; left: 4.2rem; top: -1.1rem; }
.kc-nuage--1 { top: 4rem; left: 6%; }
.kc-nuage--2 { top: 9rem; left: 58%; scale: 0.7; }
.kc-nuage--3 { top: 15rem; left: 22%; scale: 0.55; opacity: 0.8; }

.kc-scene { position: relative; }
.kc-titre { text-align: center; margin-top: 0.5rem; }
.kc-sur {
  display: inline-block; margin: 0 0 0.7rem; padding: 0.3rem 0.9rem;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase;
  background: var(--creme-kc); color: var(--rouge-fonce-kc); border-radius: 999px;
}
.kc h1 {
  margin: 0;
  font-family: "Fredoka", var(--titre);
  font-weight: 700;
  font-size: clamp(3.4rem, 11vw, 7.2rem);
  line-height: 0.95;
  color: var(--rouge-kc);
  text-shadow: 0 0.06em 0 var(--creme-kc), 0 0.12em 0 var(--rouge-fonce-kc);
}
.kc-accroche {
  margin: 1rem auto 0; max-width: 34ch;
  font-family: "Fredoka", var(--titre); font-weight: 500;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.35; color: var(--encre-kc);
}

/* La boîte au centre, les ondes derrière, les cris autour */
.kc-cour {
  position: relative;
  width: min(34rem, 100%);
  margin: clamp(1.5rem, 4vw, 2.5rem) auto 0;
  display: grid;
  place-items: center;
}
/* Ondes sonores claires qui partent de la boîte (derrière elle) */
.kc-ondes { grid-area: 1 / 1; align-self: center; position: relative; width: min(30rem, 92vw); aspect-ratio: 1; z-index: 0; }
.kc-ondes span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 0.35rem solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 0.35rem rgba(255, 255, 255, 0.25);
}
.kc-ondes span:nth-child(2) { inset: 14%; }
.kc-ondes span:nth-child(3) { inset: 28%; background: rgba(255, 255, 255, 0.35); }
.kc-boite {
  grid-area: 1 / 1;
  position: relative; z-index: 2;
  width: min(17rem, 58vw);
}
.kc-boite picture { display: contents; }
.kc-boite img { width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 20px 18px rgba(29, 42, 34, 0.45)); }

.kc-cris { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0 -42%; z-index: 1; pointer-events: none; }
.kc-cri {
  position: absolute;
  padding: 0.45rem 0.9rem;
  font-family: "Fredoka", var(--titre); font-weight: 700; font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  white-space: nowrap;
  color: var(--encre-kc);
  background: #fff;
  border: 3px solid var(--encre-kc);
  border-radius: 1.2rem;
  box-shadow: 0 4px 0 var(--encre-kc);
}
.kc-cri::after {
  content: ""; position: absolute; bottom: -0.75rem; left: 1.2rem;
  border: 0.45rem solid transparent; border-top: 0.6rem solid var(--encre-kc);
}
.kc-cri--1 { top: 18%; left: -4%; }
.kc-cri--2 { top: 8%; right: -2%; }
.kc-cri--3 { top: 46%; left: -8%; }
.kc-cri--4 { top: 40%; right: -8%; }
.kc-cri--5 { top: 88%; right: -6%; }
.kc-cri--6 { top: 70%; left: -18%; }

/* Barrière de bois */
.kc-barriere {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4.6rem;
  background:
    linear-gradient(#fdf6e3, #fdf6e3) 0 1.1rem / 100% 0.55rem no-repeat,
    linear-gradient(#fdf6e3, #fdf6e3) 0 2.7rem / 100% 0.55rem no-repeat,
    linear-gradient(var(--herbe-fonce), var(--herbe-fonce)) 0 100% / 100% 0.9rem no-repeat,
    repeating-linear-gradient(90deg, transparent 0 1.6rem, #fdf6e3 1.6rem 2.4rem, transparent 2.4rem 4rem);
  border-bottom: 0.9rem solid var(--herbe-fonce);
}

/* ---------- Le pré (contenu) ---------- */
.kc-pre { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.kc-pre__grille { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.kc-carnet {
  position: relative;
  padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.4rem, 4vw, 2.4rem) clamp(1.6rem, 4vw, 2.4rem) clamp(2.6rem, 6vw, 3.4rem);
  background:
    linear-gradient(90deg, transparent 0 1.6rem, rgba(168, 51, 42, 0.35) 1.6rem 1.75rem, transparent 1.75rem),
    repeating-linear-gradient(180deg, transparent 0 1.9rem, rgba(36, 65, 77, 0.14) 1.9rem 2rem),
    #fff;
  border-radius: 6px;
  box-shadow: 0 18px 36px -24px rgba(29, 42, 34, 0.55);
}
.kc-carnet h2 { font-family: "Fredoka", var(--titre); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--rouge-kc); margin: 0 0 0.8rem; }
.kc-description { font-size: 1.12rem; line-height: 2rem; color: var(--encre-kc); max-width: 60ch; }
.kc .bouton { background: var(--rouge-kc); border-color: var(--rouge-fonce-kc); color: #fff; border-radius: 999px; }
.kc .bouton:hover { background: var(--rouge-fonce-kc); color: #fff; }
.kc .bouton--clair { background: transparent; color: var(--rouge-fonce-kc); border-color: var(--rouge-fonce-kc); }
.kc .liens-secondaires a { color: var(--rouge-fonce-kc); font-weight: 600; }

.kc-bottes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.kc-bottes li {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 1.1rem;
  font-family: "Fredoka", var(--titre); font-weight: 600; font-size: 1.15rem;
  background: #f4d9a0; color: #3d2a14;
  border-radius: 0.6rem;
  box-shadow: inset 0 -0.35rem 0 rgba(122, 79, 42, 0.25);
}
.kc-bottes svg { width: 1.6rem; height: 1.6rem; flex: none; color: var(--rouge-fonce-kc); }
.kc-equipe { margin-top: 1.8rem; }
.kc-equipe h2 { font-family: "Fredoka", var(--titre); font-weight: 700; font-size: 1.5rem; color: var(--rouge-kc); margin: 0 0 0.4rem; }
.kc-credits { margin: 0; }
.kc-credits div { padding: 0.55rem 0; border-top: 2px dashed rgba(29, 42, 34, 0.25); }
.kc-credits dt { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--doux-kc); }
.kc-credits dd { margin: 0.15rem 0 0; font-size: 1.02rem; }
.kc-prix { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 0.8rem; }
.kc-prix li { display: flex; gap: 0.8rem; align-items: center; }
.kc-prix svg { width: 2.4rem; height: 2.4rem; color: var(--rouge-kc); flex: none; }
.kc-prix strong { display: block; }

.kc-cadre {
  margin: clamp(3rem, 6vw, 4rem) auto 0; max-width: 58rem;
  padding: 0.9rem 0.9rem 0;
  background: #fff; border-radius: 10px;
  border: 0.55rem solid var(--bois-kc);
}
.kc-cadre img { width: 100%; height: auto; border-radius: 4px; }
.kc-cadre figcaption { font-family: "Fredoka", var(--titre); font-weight: 600; text-align: center; padding: 0.6rem 0 0.8rem; }

@media (max-width: 52rem) {
  .kc-pre__grille { grid-template-columns: minmax(0, 1fr); }
  /* Sur petit écran, les bulles sortent au-dessus de la boîte, jamais dessus. */
  .kc-cour { padding-top: 3.6rem; }
  .kc-cris { inset: 0 0 auto; height: 3rem; }
  .kc-cri { font-size: 0.9rem; padding: 0.35rem 0.7rem; top: 0; left: auto; right: auto; }
  .kc-cri--1, .kc-cri--4 { left: 0; }
  .kc-cri--2, .kc-cri--5 { left: 36%; }
  .kc-cri--3, .kc-cri--6 { right: 0; }
}
@media (max-width: 52rem) and (prefers-reduced-motion: reduce) {
  .kc-cri--4, .kc-cri--5, .kc-cri--6 { display: none; }
}

/* Sans animation, les bulles restent visibles et posées. */
@media (prefers-reduced-motion: no-preference) {
  .kc-nuage--1 { animation: kc-nuage 70s linear infinite; }
  .kc-nuage--2 { animation: kc-nuage 95s linear infinite -30s; }
  .kc-nuage--3 { animation: kc-nuage 120s linear infinite -60s; }
  @keyframes kc-nuage { from { translate: -40vw 0; } to { translate: 110vw 0; } }
  .kc-soleil { animation: kc-soleil 6s ease-in-out infinite; }
  @keyframes kc-soleil { 50% { box-shadow: 0 0 0 1.6rem rgba(255, 226, 120, 0.3), 0 0 0 3.2rem rgba(255, 226, 120, 0.1); } }
  .kc-ondes span { animation: kc-onde 3s ease-out infinite; }
  .kc-ondes span:nth-child(2) { animation-delay: 1s; }
  .kc-ondes span:nth-child(3) { animation-delay: 2s; }
  @keyframes kc-onde { 0% { scale: 0.45; opacity: 0; } 20% { opacity: 1; } 100% { scale: 1.08; opacity: 0; } }
  .kc-cri { opacity: 0; transform-origin: 20% 100%; animation: kc-cri 12s ease-in-out infinite; }
  .kc-cri--2 { animation-delay: 2s; }
  .kc-cri--3 { animation-delay: 4s; }
  .kc-cri--4 { animation-delay: 6s; }
  .kc-cri--5 { animation-delay: 8s; }
  .kc-cri--6 { animation-delay: 10s; }
  @keyframes kc-cri {
    0% { opacity: 0; scale: 0.3; translate: 0 1rem; }
    4% { opacity: 1; scale: 1.12; translate: 0 0; }
    7% { scale: 1; }
    20% { opacity: 1; scale: 1; }
    25%, 100% { opacity: 0; scale: 0.8; translate: 0 -0.6rem; }
  }
  .kc h1 { animation: kc-crie 12s ease-in-out infinite; transform-origin: 50% 90%; }
  @keyframes kc-crie { 0%, 88%, 100% { scale: 1; } 91% { scale: 1.05 0.95; } 94% { scale: 0.97 1.04; } }
}
