/* ==========================================================================
   Illustration de la mare, bouton « Écoute mon histoire », texte d'introduction
   ========================================================================== */

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  box-shadow: 0 0 0 1px rgba(23, 37, 31, 0.06), 0 20px 60px rgba(23, 37, 31, 0.09);
}

.scene {
  position: relative;
  min-height: 44vh;
  padding: 18px 16px 22px;
  overflow: hidden;
  /* Prolonge la teinte des bords de l'illustration au-dessus et sous la mare. */
  background: #cce8e0;
}

.pond-card {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  background: #cce8e0;
  box-shadow: none;
}

.panel-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.water-glow {
  position: absolute;
  width: 24%;
  height: 12%;
  border: 2px solid rgba(255, 253, 247, 0.8);
  border-radius: 50%;
  opacity: 0;
  animation: ripple 3.8s ease-out infinite;
  pointer-events: none;
}

.water-glow-one {
  top: 56%;
  left: 36%;
}

.water-glow-two {
  top: 60%;
  left: 58%;
  animation-delay: 1.4s;
}

.water-line {
  position: absolute;
  top: 68%;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.88);
  transform-origin: center;
  animation: waterline 3.8s ease-in-out infinite;
}

.pond-duck {
  position: absolute;
  top: 44%;
  left: 18%;
  z-index: 3;
  width: 13.6%;
  min-width: 39px;
  max-width: 62px;
  opacity: 0.96;
  filter: drop-shadow(0 5px 7px rgba(36, 58, 52, 0.16));
  transform-origin: center;
  animation: pondDuckSwim 18s ease-in-out 3.6s infinite;
  pointer-events: none;
}

.bubble {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 0 0 8px rgba(255, 253, 247, 0.7);
  animation: bubble 4.6s ease-in-out infinite;
}

.bubble-one {
  top: 78%;
  left: 50%;
}

.bubble-two {
  top: 73%;
  left: 35%;
  animation-delay: 1.5s;
}

.bubble-three {
  top: 69%;
  left: 75%;
  animation-delay: 2.4s;
}

.swallow {
  position: absolute;
  top: 18%;
  left: -30%;
  z-index: 3;
  width: 26%;
  min-width: 86px;
  max-width: 128px;
  opacity: 0;
  filter: drop-shadow(0 7px 8px rgba(36, 58, 52, 0.18));
  transform: translate3d(0, 0, 0) rotate(-4deg) scale(0.72);
  animation: swallowFlight 14s ease-in-out 2.4s infinite;
  pointer-events: none;
}

.pond-heron {
  position: absolute;
  top: 17%;
  left: -44%;
  z-index: 3;
  width: 78%;
  max-width: 360px;
  opacity: 0;
  clip-path: polygon(
    46% 24%,
    47% 18%,
    50% 13%,
    55% 10%,
    61% 9%,
    67% 10%,
    71% 13%,
    74% 15%,
    79% 15%,
    100% 15%,
    100% 19%,
    83% 20%,
    77% 23%,
    73% 25%,
    69% 27%,
    65% 29%,
    61% 30%,
    57% 30%,
    53% 29%,
    49% 27%,
    46% 25%
  );
  filter: drop-shadow(0 5px 7px rgba(36, 58, 52, 0.18));
  /* Le pivot reste fixe hors cadre, au point où le cou rejoint le corps. */
  transform-origin: 50% 40%;
  animation: heronGreeting 14s ease-in-out 2.4s infinite;
  pointer-events: none;
}

.pond-newt-swimmer {
  position: absolute;
  top: 56%;
  left: 7%;
  z-index: 3;
  width: 9.8%;
  min-width: 32px;
  max-width: 46px;
  opacity: 0.94;
  filter: drop-shadow(0 5px 7px rgba(36, 58, 52, 0.2));
  transform-origin: center;
  animation: pondNewtSwim 20s ease-in-out 1.8s infinite;
  pointer-events: none;
}

.midge {
  position: absolute;
  z-index: 3;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(36, 58, 52, 0.74);
  box-shadow: 0 0 5px rgba(255, 250, 240, 0.88);
  animation: midgeFloat 5.4s ease-in-out infinite;
  pointer-events: none;
}

.midge::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 1px solid rgba(255, 250, 240, 0.5);
  border-radius: 50%;
  opacity: 0.7;
}

.midge-one {
  top: 46%;
  left: 28%;
}

.midge-two {
  top: 40%;
  left: 42%;
  width: 4px;
  height: 4px;
  animation-delay: 0.8s;
  animation-duration: 6.2s;
}

.midge-three {
  top: 48%;
  left: 62%;
  width: 4px;
  height: 4px;
  animation-delay: 1.4s;
  animation-duration: 5.8s;
}

.midge-four {
  top: 42%;
  left: 72%;
  width: 6px;
  height: 6px;
  animation-delay: 2.1s;
  animation-duration: 7s;
}

.midge-five {
  top: 54%;
  left: 52%;
  width: 3px;
  height: 3px;
  animation-delay: 2.8s;
  animation-duration: 4.8s;
}

.borne-label {
  color: #6f9f78;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.content h1 .title-timon {
  color: var(--leaf);
  -webkit-text-fill-color: currentColor;
}

.intro {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.58;
}

.app-shell,
.content {
  background: #fff;
}

h2 {
  font-family: var(--serif);
  letter-spacing: -0.035em;
}

.content {
  padding: 26px 18px 42px;
}

.scene .pond-card {
  width: calc(100% + 32px);
  margin-inline: -16px;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.story-button {
  position: relative;
  z-index: 5;
  isolation: isolate;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  align-self: center;
  justify-items: center;
  gap: 18px;
  width: min(100%, 225px);
  min-height: 94px;
  margin: 0;
  padding: 11px 28px;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  color: #fff;
  background: #1c91d0;
  box-shadow: 0 7px 0 rgba(17, 65, 101, 0.58),
    0 15px 26px rgba(30, 116, 170, 0.25);
  font-family: "Trebuchet MS", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-align: left;
}

.story-button::before {
  content: "";
  position: absolute;
  inset: -18px -22px -10px;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 50%, rgba(86, 184, 235, 0.26), transparent 66%);
  pointer-events: none;
}

.story-button:hover,
.story-button:focus-visible {
  background: #1687c7;
  box-shadow: 0 9px 0 rgba(17, 65, 101, 0.56),
    0 17px 30px rgba(30, 116, 170, 0.3);
  transform: translateY(-2px);
}

.story-sound-icon {
  display: block;
  justify-self: center;
  width: 48px;
  height: auto;
  filter: brightness(0) invert(1);
}

.story-button span {
  justify-self: start;
  transform: translateY(1px);
}

html[lang="en"] .story-button {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  width: min(100%, 280px);
  padding-inline: 16px;
  font-size: 15px;
}

.story-action-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.95fr) minmax(205px, 1.05fr);
  align-items: end;
  gap: 2px;
  width: calc(100% - 44px);
  max-width: 450px;
  min-height: 132px;
  margin: 10px auto 0;
  overflow: visible;
}

.story-triton {
  display: block;
  align-self: end;
  justify-self: end;
  width: min(112%, 210px);
  height: auto;
  margin: 0 -10px -2px 0;
  pointer-events: none;
  user-select: none;
}

.scene:has(.story-action-row) {
  padding-bottom: 0;
}

.story-button::after {
  --story-ring-angle: 0deg;
  content: "";
  position: absolute;
  inset: -7px;
  z-index: 2;
  padding: 4px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--story-ring-angle),
    rgba(5, 77, 145, 0.46) 0deg 205deg,
    rgba(12, 139, 220, 0.74) 242deg,
    #9eeeff 278deg,
    #27bfff 311deg,
    rgba(5, 77, 145, 0.5) 346deg 360deg
    ),
    repeating-conic-gradient(
    from var(--story-ring-angle),
    #075ca8 0deg 5deg,
    #27bfff 5deg 8deg,
    rgba(157, 234, 255, 0.28) 8deg 10deg,
    transparent 10deg 14deg
    );
  background-blend-mode: screen;
  opacity: 0;
  filter: drop-shadow(0 0 3px rgba(60, 198, 255, 0.88))
    drop-shadow(0 0 7px rgba(26, 139, 224, 0.42));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.story-button.active::after {
  opacity: 1;
  animation: story-reading-ring 1.82s linear infinite;
}

@media (min-width: 700px) {
  .app-shell {
    min-height: auto;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(23, 37, 31, 0.12);
  }
}

@media (max-width: 380px) {
  .story-button {
    grid-template-columns: 46px 1fr;
    gap: 14px;
    width: min(100%, 210px);
    min-height: 80px;
    padding: 10px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-button.active::after {
    animation-duration: 3s;
  }
}

@media (max-height: 720px) {
  .story-button {
    min-height: 80px;
    font-size: 17px;
  }

  .story-sound-icon {
    width: 41px;
  }
}

@media (max-width: 380px) {
  .story-action-row {
    grid-template-columns: minmax(145px, 0.9fr) minmax(190px, 1.1fr);
    width: 100%;
    min-height: 116px;
  }

  .story-triton {
    width: 158px;
    margin-right: -8px;
  }

  .story-sound-icon {
    width: 41px;
  }
}

@keyframes ripple {
  0% {
    transform: scale(0.4);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

@keyframes waterline {
  50% {
    transform: translateY(3px) scaleX(0.96);
    opacity: 0.68;
  }
}

@keyframes pondDuckSwim {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scaleX(1) rotate(0deg);
  }
  42% {
    transform: translate3d(440%, -1px, 0) scaleX(1) rotate(-1deg);
  }
  45% {
    transform: translate3d(440%, -1px, 0) scaleX(-1) rotate(0deg);
  }
  88% {
    transform: translate3d(0, 0, 0) scaleX(-1) rotate(1deg);
  }
  92% {
    transform: translate3d(0, 0, 0) scaleX(1) rotate(0deg);
  }
}

@keyframes bubble {
  0%,
  100% {
    transform: translateY(0) scale(0.7);
    opacity: 0;
  }
  30% {
    opacity: 0.85;
  }
  80% {
    transform: translateY(-42px) scale(1);
    opacity: 0;
  }
}

@keyframes swallowFlight {
  0%,
  32%,
  100% {
    opacity: 0;
    transform: translate3d(-20%, 0, 0) rotate(-4deg) scale(0.72);
  }
  38% {
    opacity: 1;
  }
  50% {
    opacity: 1;
    transform: translate3d(220%, -34%, 0) rotate(6deg) scale(0.86);
  }
  62% {
    opacity: 1;
    transform: translate3d(430%, 28%, 0) rotate(-7deg) scale(0.76);
  }
  70% {
    opacity: 0;
    transform: translate3d(560%, -8%, 0) rotate(-3deg) scale(0.7);
  }
}

@keyframes heronGreeting {
  0%,
  70%,
  100% {
    opacity: 0;
    transform: rotate(-12deg);
  }
  74% {
    opacity: 0;
    transform: rotate(-12deg);
  }
  77% {
    opacity: 1;
    transform: rotate(-8deg);
  }
  82% {
    opacity: 1;
    transform: rotate(2deg);
  }
  86%,
  89% {
    opacity: 1;
    transform: rotate(20deg);
  }
  93% {
    opacity: 1;
    transform: rotate(10deg);
  }
  97% {
    opacity: 1;
    transform: rotate(-8deg);
  }
}

@keyframes pondNewtSwim {
  0%,
  100% {
    transform: translate3d(0, 70%, 0) scaleX(1) scale(1) rotate(-2deg);
  }
  15% {
    transform: translate3d(250%, 70%, 0) scaleX(1) scale(1.15) rotate(1deg);
  }
  28% {
    transform: translate3d(560%, 95%, 0) scaleX(1) scale(1.45) rotate(2deg);
  }
  34% {
    transform: translate3d(760%, 80%, 0) scaleX(1) scale(1.2) rotate(1deg);
  }
  36% {
    transform: translate3d(760%, 80%, 0) scaleX(-1) scale(1.2) rotate(-1deg);
  }
  42% {
    transform: translate3d(560%, 95%, 0) scaleX(-1) scale(1.45) rotate(-2deg);
  }
  55% {
    transform: translate3d(250%, 70%, 0) scaleX(-1) scale(1.15) rotate(-1deg);
  }
  98% {
    transform: translate3d(0, 70%, 0) scaleX(-1) scale(1) rotate(2deg);
  }
}

@keyframes midgeFloat {
  0%,
  100% {
    opacity: 0.25;
    transform: translate3d(0, 0, 0) scale(0.8);
  }
  22% {
    opacity: 0.85;
    transform: translate3d(12px, -9px, 0) scale(1);
  }
  48% {
    opacity: 0.58;
    transform: translate3d(-7px, -18px, 0) scale(0.72);
  }
  74% {
    opacity: 0.9;
    transform: translate3d(16px, 4px, 0) scale(1.05);
  }
}

@keyframes story-reading-ring {
  to {
    --story-ring-angle: 360deg;
  }
}
