/* =========================================================
   PANDALION — Parcel House (tracking page)
   ========================================================= */
.parcel-page { background: linear-gradient(180deg, #fff1cc 0, var(--cream) 520px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.parcel-main { padding: 120px 0 90px; display: flex; flex-direction: column; gap: 22px; }

/* ----- hero / search ----- */
.track-hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; align-items: center; }
.track-hero-text { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.track-hero h1 { font-size: clamp(38px, 6vw, 62px); }
.track-hero h1 span { color: #d9962a; }
.track-hero p { color: var(--ink-soft); font-weight: 600; font-size: 17px; max-width: 520px; }
.track-form { display: flex; gap: 12px; width: min(100%, 520px); margin-top: 6px; }
.track-form .input { flex: 1; min-width: 0; }
.track-form .btn { flex: none; }
.track-hero-art { width: min(100%, 380px); justify-self: center; filter: drop-shadow(0 18px 24px rgba(120, 90, 30, .18)); animation: bob 5s ease-in-out infinite; }

/* ----- cards ----- */
.track-card {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft); padding: 28px 30px 30px;
  animation: cardIn .5s var(--bounce) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

.state-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 24px; }
.state-card h2 { font-size: 28px; }
.state-card h2 span { color: #d9962a; overflow-wrap: anywhere; }
.state-card p { color: var(--ink-soft); font-weight: 600; max-width: 460px; }
.state-emoji { font-size: 64px; line-height: 1; }
.spin-slow { animation: bob 1.4s ease-in-out infinite; }

/* ----- result header ----- */
.track-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 2px dashed var(--line); }
.order-no { font-family: var(--font-head); font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.order-no span { color: #d9962a; overflow-wrap: anywhere; }
.eta, .now-status { font-size: 14.5px; color: var(--ink-soft); font-weight: 700; }
.eta b, .now-status b { color: var(--ink); }
.courier { text-align: right; display: flex; flex-direction: column; }
.courier small { color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.courier b { font-family: var(--font-head); font-size: 18px; }

/* ----- journey: road + steps ----- */
.journey { --p: 0; --dot: 64px; position: relative; margin-top: 34px; }
.road {
  position: absolute; z-index: 0; top: calc(var(--dot) / 2 - 5px);
  left: calc(100% / 12); right: calc(100% / 12); height: 10px;
  background: repeating-linear-gradient(90deg, #efe6d3 0 14px, #f7f0e1 14px 22px); border-radius: 99px;
}
.road-fill {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%);
  background: linear-gradient(90deg, var(--sage), var(--honey)); border-radius: 99px;
  transition: width 1.4s cubic-bezier(.3, .9, .3, 1);
}
#result { display: flex; flex-direction: column; gap: 26px; }
.road-bike {
  position: absolute; z-index: 3; top: -34px; left: calc(100% / 12 + var(--p) * (100% - 100% / 6)); transform: translateX(-50%);
  font-size: 30px; transition: left 1.4s cubic-bezier(.3, .9, .3, 1); animation: pedal .5s ease-in-out infinite alternate;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.15));
}
@keyframes pedal { to { margin-top: -3px; } }

.steps { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.step-dot {
  position: relative; width: var(--dot); height: var(--dot); border-radius: 50%;
  display: grid; place-items: center; background: #f4efe5; border: 3px solid var(--line);
  font-size: 30px; transition: transform .3s var(--bounce);
}
.step-icon { filter: grayscale(1); opacity: .45; transition: filter .4s, opacity .4s; }
.step-tick {
  position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--sage); color: #fff; font-size: 13px; font-weight: 900; display: none; place-items: center; border: 2px solid #fff;
}
.step-text b { display: block; font-size: 14.5px; line-height: 1.25; color: #9c9384; }
.step-text small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 700; color: #b5ad9e; }

.step.done .step-dot { background: var(--sage-soft); border-color: var(--sage); }
.step.done .step-icon, .step.current .step-icon { filter: none; opacity: 1; }
.step.done .step-tick { display: grid; }
.step.done .step-text b { color: var(--ink); }
.step.done .step-text small { color: var(--ink-soft); }
.step.current .step-dot { background: var(--honey-soft); border-color: var(--honey); transform: scale(1.12); box-shadow: 0 0 0 7px rgba(247, 198, 92, .25); animation: glow 1.8s ease-in-out infinite; }
.step.current .step-icon { animation: wiggle 2.2s infinite; }
.step.current .step-text b { color: var(--ink); }
.step.current .step-text small { color: #b07a1d; }
@keyframes glow { 50% { box-shadow: 0 0 0 12px rgba(247, 198, 92, .12); } }

/* ----- bamboo scroll note ----- */
.scroll { width: min(100%, 760px); margin: 6px auto 0; filter: drop-shadow(0 16px 22px rgba(90, 70, 30, .18)); }
.rod {
  position: relative; z-index: 2; height: 24px; margin: 0 -26px; border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, transparent 0 116px, rgba(60, 90, 30, .45) 116px 119px, rgba(255, 255, 255, .35) 119px 121px, transparent 121px 160px),
    linear-gradient(180deg, #b7d77a 0%, #8fbf4f 38%, #6f9e35 72%, #5a842a 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .12), 0 4px 6px rgba(60, 80, 20, .25);
}
.rod::before, .rod::after {   /* cut bamboo ends */
  content: ""; position: absolute; top: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle, #e8d9a8 0 35%, #c9b47a 36% 55%, #7c9c3d 56%);
}
.rod::before { left: -6px; } .rod::after { right: -6px; }
.paper {
  position: relative; margin: -6px 0; padding: 34px 44px;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, .55), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(196, 160, 90, .16), transparent 60%),
    linear-gradient(90deg, #f3e3b8 0%, #fbf0d2 8%, #fdf5df 50%, #fbf0d2 92%, #f3e3b8 100%);
  transform-origin: top center; animation: unroll .9s cubic-bezier(.3, .9, .3, 1) both .15s;
}
.paper::before, .paper::after {   /* soft rolled shading near the rods */
  content: ""; position: absolute; left: 0; right: 0; height: 16px; pointer-events: none;
}
.paper::before { top: 0; background: linear-gradient(180deg, rgba(120, 90, 40, .18), transparent); }
.paper::after { bottom: 0; background: linear-gradient(0deg, rgba(120, 90, 40, .18), transparent); }
.note-text {
  margin: 0; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: var(--font-head); font-size: clamp(18px, 2.4vw, 22px); font-weight: 500; line-height: 1.65; color: #4a3b22;
}
@keyframes unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* ----- celebration ----- */
.confetti { position: fixed; top: -40px; z-index: 300; pointer-events: none; animation: confettiFall 3.6s ease-in forwards; }
@keyframes confettiFall { to { transform: translateY(110vh) rotate(540deg); opacity: .8; } }

/* ----- phones: vertical journey ----- */
@media (max-width: 760px) {
  .parcel-main { padding-top: 104px; }
  .track-hero { grid-template-columns: 1fr; text-align: left; }
  .track-hero-art { width: 210px; order: -1; justify-self: start; }
  .track-form { flex-direction: column; }
  .track-card { padding: 22px 18px 24px; }
  .rod { margin: 0 -10px; }
  .paper { padding: 26px 22px; }
  .courier { text-align: left; }
  .journey { --dot: 54px; margin-top: 26px; }
  .road { top: calc(var(--dot) / 2); bottom: calc(var(--dot) / 2); left: calc(var(--dot) / 2 - 5px); right: auto; width: 10px; height: auto;
          background: repeating-linear-gradient(180deg, #efe6d3 0 14px, #f7f0e1 14px 22px); }
  .road-fill { inset: 0 0 auto 0; width: auto; height: calc(var(--p) * 100%); background: linear-gradient(180deg, var(--sage), var(--honey)); transition: height 1.4s cubic-bezier(.3, .9, .3, 1); }
  .road-bike { display: none; }
  .steps { grid-template-columns: 1fr; gap: 16px; }
  .step { flex-direction: row; text-align: left; gap: 14px; }
  .step-dot { flex: none; font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  .track-hero-art, .road-bike, .step.current .step-dot, .step.current .step-icon, .paper { animation: none; }
}
