/* =========================================================
   Story sections 01–04, final CTA, footer
   Desktop: photo and text side by side, alternating.
   Phone:   photo on top, text below.
   ========================================================= */

.story {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 7vw, 96px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 40px;
}
.features + .story { padding-top: 120px; }

.story--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); }
.story--flip .story__media { order: 2; }

.story__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  background: #ebe7dc;
  box-shadow: 0 30px 60px -24px rgba(50, 45, 25, .3);
}
.story__media img {
  width: 100%;
  height: 112%;
  margin-top: -6%;
  object-fit: cover;
  transform: translate3d(0, var(--sy, 0), 0);
  will-change: transform;
}

.story__text { max-width: 440px; }
.story--flip .story__text { justify-self: end; }

.story__num {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #9cbfa3;
}
.story__title {
  margin-top: 10px;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.025em;
  color: var(--c-ink);
}
.story__desc {
  margin-top: 18px;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--c-muted);
}
.story__tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-green-500);
}
.story__tag::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: left;
}

/* ---------- scroll reveal (JS adds .is-in) ---------- */
.js .story__media[data-reveal] {
  clip-path: inset(10% 10% 10% 10% round 24px);
  opacity: 0;
  transition:
    clip-path 1.2s var(--ease-out),
    opacity .6s var(--ease-out);
}
.js .story__media[data-reveal] img { scale: 1.15; transition: scale 1.6s var(--ease-out); }
.js .story__media[data-reveal].is-in {
  clip-path: inset(0 0 0 0 round 24px);
  opacity: 1;
}
.js .story__media[data-reveal].is-in img { scale: 1; }

.js .story__text[data-reveal] > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.js .story__text[data-reveal].is-in > * { opacity: 1; transform: none; }
.js .story__text[data-reveal].is-in > :nth-child(2) { transition-delay: .08s; }
.js .story__text[data-reveal].is-in > :nth-child(3) { transition-delay: .16s; }
.js .story__text[data-reveal].is-in > :nth-child(4) { transition-delay: .24s; }

.js .story__text[data-reveal] .story__tag::before { transform: scaleX(0); transition: transform .8s var(--ease-out) .5s; }
.js .story__text[data-reveal].is-in .story__tag::before { transform: scaleX(1); }

/* =========================================================
   Final CTA
   ========================================================= */
.finale {
  position: relative;
  overflow: hidden;
  max-width: 1120px;
  margin: 72px auto 0;
  padding: 72px 40px;
  border-radius: 28px;
  background:
    radial-gradient(120% 140% at 85% 0%, #2f8553 0%, rgba(47, 133, 83, 0) 55%),
    var(--c-green);
  color: #fff;
  text-align: center;
  box-shadow: 0 40px 80px -40px rgba(20, 70, 40, .55);
}
.finale__title {
  position: relative;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.finale__sub {
  position: relative;
  margin-top: 12px;
  font-size: 18px;
  font-weight: 300;
  color: rgba(255, 255, 255, .82);
}
.btn-light {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-top: 30px;
  padding: 0 30px;
  border-radius: 999px;
  background: #fff;
  color: var(--c-green);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .14);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.btn-light svg { width: 26px; height: 26px; }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 20px 36px rgba(0, 0, 0, .2); }
.btn-light:active { transform: scale(.98); }

.finale__leaf {
  position: absolute;
  opacity: .35;
  animation: leaf-float 8s ease-in-out infinite;
}
.finale__leaf--1 { left: 6%; top: -18px; width: 70px; height: 105px; --r: 140deg; }
.finale__leaf--2 { right: 5%; bottom: -24px; width: 84px; height: 126px; --r: -30deg; animation-delay: -3s; }

.js .finale[data-reveal] {
  opacity: 0;
  transform: translateY(40px) scale(.97);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.js .finale[data-reveal].is-in { opacity: 1; transform: none; }

.footer {
  padding: 36px 20px 40px;
  text-align: center;
  font-size: 14px;
  color: var(--c-muted-2);
}

/* =========================================================
   Phone: photo on top, text below
   ========================================================= */
@media (max-width: 860px) {
  .story,
  .story--flip {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 560px;
    padding: 44px 20px;
  }
  .hero + .features + .story { padding-top: 24px; }
  .story--flip .story__media { order: 0; }
  .story--flip .story__text { justify-self: start; }
  .story__media { aspect-ratio: 1 / 1; border-radius: 20px; }
  .story__desc { font-size: 17px; }

  .finale {
    margin: 40px 16px 0;
    padding: 52px 24px;
    border-radius: 24px;
  }
  .finale__sub { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .story__media img { transform: none; }
  .js [data-reveal],
  .js [data-reveal] > *,
  .js .story__media[data-reveal] img { opacity: 1; transform: none; clip-path: none; scale: 1; }
}
