/* =========================================================
   How we plan — 6 ขั้นตอน + เส้นทางประ + แอนิเมชันเข้า + parallax
   ========================================================= */
.plan {
  --pl-peach: #fde6d6;
  --pl-orange: #ee7b3a;
  --pl-glass: rgba(255, 255, 255, .8);
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(64px, 7vw, 100px) 0 clamp(150px, 14vw, 220px);
  background:
    radial-gradient(ellipse 50% 30% at 50% 0%, #fff 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, var(--ivory) 0%, #fbf1ea 30%, #f6f2f2 60%, #eef3f9 85%, #f8f4ee 100%);
}

/* ---------- ฉากหลัง ---------- */
.pl-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.pl-deco { position: absolute; display: block; }
.pl-blossom-tl { left: -2%; top: 0; width: clamp(140px, 17vw, 280px); }
.pl-mtn-tr { right: -8%; top: 1%; width: 38%; opacity: .55; filter: saturate(.75) brightness(1.1); }
.pl-wall-tr { right: -6%; top: 4%; width: 24%; opacity: .9; }
.pl-cloud-a { right: 2%; top: 13%; width: 22%; opacity: .9; }
.pl-cloud-b { left: -4%; top: 38%; width: 24%; opacity: .55; }
.pl-cloud-c { right: -3%; top: 62%; width: 22%; opacity: .55; }
.pl-mtn-bottom { left: 8%; right: 0; bottom: 70px; width: 90%; opacity: .55; filter: saturate(.7) brightness(1.15); }
.pl-temple-bl { left: 1%; bottom: 80px; width: clamp(110px, 11vw, 180px); opacity: .9; }
.pl-blossom-br { right: -2%; bottom: 20px; width: clamp(130px, 15vw, 250px); scale: -1 -1; }
.pl-ribbon { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(50px, 6vw, 90px); }

.pl-inner { position: relative; max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------- หัวเรื่อง ---------- */
.pl-header { text-align: center; display: grid; justify-items: center; margin-bottom: clamp(28px, 4vw, 56px); }
.pl-eyebrow {
  position: relative; margin: 0; font-family: var(--font-script); font-size: clamp(34px, 3.2vw, 48px);
  color: var(--red); line-height: 1; display: inline-flex; align-items: flex-end; gap: 6px;
}
.pl-eyebrow svg { width: 90px; height: 24px; margin-bottom: 14px; }
.pl-eyebrow .ln { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linecap: round; }
.pl-eyebrow .pl { fill: var(--red); }
.pl-header h2 {
  display: flex; align-items: center; gap: clamp(10px, 2vw, 26px); margin: 4px 0 0;
  font-weight: 700; font-style: italic; font-size: clamp(28px, 3.6vw, 50px); color: var(--navy); line-height: 1.2; text-wrap: balance;
}
.pl-sub { margin: 8px 0 0; font-size: clamp(14px, 1.2vw, 18px); color: #33415a; }

/* ---------- แถวขั้นตอน ---------- */
.pl-steps { position: relative; display: grid; gap: clamp(10px, 1.4vw, 18px); }
.pl-route { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; overflow: visible; }
.pl-route path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 9 9; }
.pl-route-base { stroke: rgba(200, 40, 50, .16); }
.pl-route-draw { stroke: #d32f3a; }

.pl-row {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}
.pl-row.is-left .pl-card { grid-column: 1; grid-row: 1; margin-right: -3%; }
.pl-row.is-left .pl-photo { grid-column: 2; grid-row: 1; margin-left: -1%; }
.pl-row.is-right .pl-photo { grid-column: 1; grid-row: 1; margin-right: -1%; }
.pl-row.is-right .pl-card { grid-column: 2; grid-row: 1; margin-left: -3%; }

.pl-card {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 20px; align-items: start;
  padding: 30px 34px 30px 30px;
  border-radius: 64px;
  background: var(--pl-glass);
  backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1.5px solid rgba(255, 255, 255, .95);
  box-shadow: 0 24px 50px -26px rgba(120, 60, 50, .35), inset 0 1px 0 #fff;
  transition: box-shadow .4s ease;
}
.pl-card:hover { box-shadow: 0 30px 60px -24px rgba(142, 16, 24, .35), 0 0 0 3px rgba(214, 173, 101, .3), inset 0 1px 0 #fff; }
.pl-num {
  grid-column: 1; grid-row: 1; justify-self: center;
  padding: 3px 14px 4px; border-radius: 999px;
  background: linear-gradient(180deg, #c92a33, var(--red)); color: #fff;
  font-weight: 700; font-size: 22px; letter-spacing: .02em; line-height: 1.2;
  box-shadow: 0 8px 16px -8px rgba(142, 16, 24, .8);
}
.pl-icon {
  grid-column: 1; grid-row: 2; justify-self: center; margin-top: 12px;
  width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff3ea, var(--pl-peach));
  box-shadow: 0 10px 20px -12px rgba(238, 123, 58, .7);
}
.pl-icon svg { width: 36px; height: 36px; fill: none; stroke: var(--pl-orange); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pl-icon .f { fill: var(--pl-orange); stroke: none; }
.pl-body { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 0; }
.pl-body h3 { margin: 0 0 10px; font-size: clamp(20px, 2vw, 28px); font-weight: 700; color: var(--navy); line-height: 1.25; }
.pl-desc { margin: 0; font-size: 16px; line-height: 1.7; color: #1f2a3d; }
.pl-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl-checks li { display: flex; align-items: flex-start; gap: 10px; font-size: 15.5px; color: #1f2a3d; line-height: 1.5; }
.pl-checks svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; fill: none; stroke: #d32f3a; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pl-plane { position: absolute; right: 30px; top: 30px; width: 26px; height: 26px; fill: rgba(238, 123, 58, .2); stroke: var(--pl-orange); stroke-width: 1.8; stroke-linejoin: round; }
.pl-247 {
  position: absolute; right: 28px; top: 50%; translate: 0 -50%;
  width: 104px; height: 104px; display: grid; place-content: center; text-align: center;
}
.pl-247 svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #d32f3a; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.pl-247 b { font-size: 28px; color: #c92a33; line-height: 1; }
.pl-247 span { font-size: 11.5px; font-weight: 600; color: #c92a33; }
.pl-row[data-step="6"] .pl-card { padding-right: 150px; }

.pl-photo {
  position: relative; z-index: 1; margin: 0;
  height: clamp(190px, 21vw, 250px);
  border-radius: 140px; overflow: hidden;
  box-shadow: 0 26px 50px -28px rgba(60, 40, 40, .45);
  -webkit-mask-image: radial-gradient(ellipse 54% 60% at 50% 50%, #000 78%, transparent 100%);
          mask-image: radial-gradient(ellipse 54% 60% at 50% 50%, #000 78%, transparent 100%);
}
.pl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s cubic-bezier(.2, .8, .2, 1); }
.pl-row:hover .pl-photo img { transform: scale(1.06); }

/* จุดบนเส้นทาง */
.pl-dot {
  position: absolute; z-index: 4; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; background: #fff; border: 3px solid rgba(211, 47, 58, .3);
  transition: border-color .4s, box-shadow .4s, transform .4s;
}
.pl-dot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: rgba(211, 47, 58, .3); transition: background .4s; }
.pl-dot.is-lit { border-color: #d32f3a; transform: scale(1.12); box-shadow: 0 0 0 7px rgba(211, 47, 58, .14), 0 0 18px rgba(211, 47, 58, .5); }
.pl-dot.is-lit::after { background: #d32f3a; }

/* ---------- แอนิเมชันเข้า (เมื่อเลื่อนมาถึง) ---------- */
.pl-row .pl-card, .pl-row .pl-photo {
  opacity: 0;
  transition: opacity .9s ease, transform 1.1s cubic-bezier(.16, .8, .24, 1), filter .9s ease, box-shadow .4s ease;
}
.pl-row.is-left .pl-card  { transform: translate3d(-70px, 20px, 0); }
.pl-row.is-right .pl-card { transform: translate3d(70px, 20px, 0); }
.pl-row.is-left .pl-photo  { transform: translate3d(80px, 30px, 0) scale(.9); filter: blur(8px); transition-delay: .12s; }
.pl-row.is-right .pl-photo { transform: translate3d(-80px, 30px, 0) scale(.9); filter: blur(8px); transition-delay: .12s; }
.pl-row.is-in .pl-card, .pl-row.is-in .pl-photo { opacity: 1; transform: none; filter: none; }

.pl-num { transform: scale(0) rotate(-20deg); transition: transform .6s cubic-bezier(.3, 1.6, .5, 1) .35s; }
.pl-icon { transform: scale(.4) rotate(-90deg); opacity: 0; transition: transform .8s cubic-bezier(.3, 1.4, .5, 1) .45s, opacity .5s ease .45s; }
.pl-row.is-in .pl-num { transform: none; }
.pl-row.is-in .pl-icon { transform: none; opacity: 1; }
.pl-body h3, .pl-desc { opacity: 0; transform: translateY(14px); transition: opacity .7s ease .35s, transform .8s ease .35s; }
.pl-checks li { opacity: 0; transform: translateX(-14px); transition: opacity .5s ease, transform .6s ease; transition-delay: calc(.55s + var(--i, 0) * .14s); }
.pl-row.is-in .pl-body h3, .pl-row.is-in .pl-desc, .pl-row.is-in .pl-checks li { opacity: 1; transform: none; }
.pl-247 { opacity: 0; transform: scale(.6) rotate(-40deg); transition: transform .9s cubic-bezier(.3, 1.4, .5, 1) .9s, opacity .5s ease .9s; }
.pl-row.is-in .pl-247 { opacity: 1; transform: none; }
.pl-row.is-in .pl-247 svg { animation: pl-spin 8s linear infinite 2s; transform-origin: 50% 50%; }
@keyframes pl-spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .pl-route, .pl-dot { display: none; }
  .pl-steps { gap: 30px; }
  .pl-row { grid-template-columns: minmax(0, 1fr); }
  .pl-row .pl-photo { grid-row: 1 !important; grid-column: 1 !important; margin: 0 !important; height: 200px; border-radius: 80px; }
  .pl-row .pl-card { grid-row: 2 !important; grid-column: 1 !important; margin: -36px 0 0 !important; padding: 24px 22px; border-radius: 40px; grid-template-columns: 58px minmax(0, 1fr); column-gap: 14px; }
  .pl-icon { width: 54px; height: 54px; }
  .pl-icon svg { width: 28px; height: 28px; }
  .pl-num { font-size: 18px; padding: 2px 10px; }
  .pl-row[data-step="6"] .pl-card { padding-right: 22px; padding-bottom: 120px; }
  .pl-247 { top: auto; bottom: 14px; right: 50%; translate: 50% 0; }
  .pl-header h2 .rv-laurel { display: none; }
  .pl-mtn-tr, .pl-wall-tr { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-row .pl-card, .pl-row .pl-photo, .pl-num, .pl-icon, .pl-body h3, .pl-desc, .pl-checks li, .pl-247 { opacity: 1 !important; transform: none !important; filter: none !important; }
}
