/* ==========================================================
   Nối các phần: đường dẫn xanh, mép giấy xé, chuyển màu giữa các phần
   ========================================================== */
main { position: relative; }

/* Con đường tự vẽ theo cuộn */
.flow-path { position: absolute; left: 0; top: 0; width: 100%; z-index: 60; pointer-events: none; overflow: visible; }
.flow-ghost { fill: none; stroke: rgba(19, 158, 73, .16); stroke-width: 2; stroke-dasharray: 2 10; stroke-linecap: round; }
.flow-line { fill: none; stroke: #59B23A; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 6px rgba(15, 92, 48, .25)); }
.flow-leaf {
  position: absolute; left: -14px; top: -14px; z-index: 61; width: 28px; height: 28px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M4 28C4 14 14 4 28 4c0 14-10 24-24 24z' fill='%2359B23A'/%3E%3Cpath d='M5 27L22 10' stroke='%23DDF2CF' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 3px 6px rgba(15, 92, 48, .35)); transition: opacity .4s; will-change: transform;
}

/* Mép giấy xé: phần sau "chồm" lên phần trước */
.journey::before, .reels::before, .letters::before {
  content: ""; position: absolute; left: 0; right: 0; top: -38px; height: 40px; z-index: 2; pointer-events: none;
  -webkit-mask: var(--torn-a) bottom / 100% 100% no-repeat; mask: var(--torn-a) bottom / 100% 100% no-repeat;
}
.journey::before { background-color: var(--tint, #EEF6E3); transition: background-color .9s ease; }
.reels::before { background-color: #F3F8EC; -webkit-mask-image: var(--torn-b); mask-image: var(--torn-b); }
.letters::before { background-color: var(--paper-2); }
.letters { overflow: visible; }
.letters > .light--soft { clip-path: inset(0); }

/* Dải chữ chạy hơi nghiêng, nối lời mở đầu với hành trình */
.marquee { rotate: -1.6deg; margin: -26px -2vw -10px; z-index: 3; box-shadow: 0 20px 40px -24px rgba(12, 46, 27, .5); }

/* Cuộn phim chồm lên phần hành trình phía trên */
.reels { margin-top: 0; }
.reels .film--a { margin-top: -40px; }

/* Hẹn gặp → Hồi ức: cỏ nối liền, màu tối tan dần sang sáng */
.meet { padding-bottom: clamp(140px, 18vh, 200px); }
.memories { margin-top: -1px; }
.memories-bg::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 260px; z-index: 2;
  background: linear-gradient(180deg, rgba(10, 50, 26, .78), rgba(10, 50, 26, 0));
}

/* Hồi ức → Tâm tình: cỏ mọc lên mép giấy */
.memories { padding-bottom: 180px; }

@media (max-width: 899px) {
  .marquee { rotate: -2deg; margin: -18px -4vw -6px; }
}
.reels { grid-template-columns: minmax(0, 1fr); }
.reels .film { min-width: 0; }

/* ---------- Cỏ & hoa cúc, đồi & nhà (lấy từ file thiết kế MỘC X) ---------- */
.deco { position: absolute; z-index: 3; pointer-events: none; user-select: none; height: auto; max-width: none; }
.deco--grass-l, .deco--grass-r { bottom: -6px; transform-origin: 50% 100%; animation: sway 7s ease-in-out infinite; }
.deco--grass-l { left: -1vw; width: clamp(240px, 30vw, 520px); }
.deco--grass-r { right: -1vw; width: clamp(160px, 19vw, 340px); animation-duration: 8.5s; animation-delay: -3s; }
@keyframes sway { 0%, 100% { rotate: 0deg; } 50% { rotate: 1.2deg; } }
.letters .deco { z-index: 0; }
/* Đồi xanh và mái nhà ở đường chân trời phía trên phần Hẹn gặp */
.deco--hills { left: 50%; top: 0; width: max(110vw, 1400px); translate: -50% -58%; z-index: 4; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .18)); }
.meet { overflow: visible; }
.meet .scene-bg { overflow: hidden; }
@media (max-width: 899px) {
  .deco--grass-l { width: 62vw; }
  .deco--grass-r { width: 36vw; }
  .deco--hills { width: 180vw; translate: -50% -55%; }
}
@media (prefers-reduced-motion: reduce) { .deco { animation: none; } }
