/* Animasi artikel Review Paper — semua kelas berawalan cb-rp- */
.cb-rp-cta, .cb-rp-chaos, .cb-rp-collect, .cb-rp-flow, .cb-rp-steps {
  --rp-g: var(--brand, #00873E);
  --rp-lime: var(--accent, #B8E86B);
  --rp-soft: var(--surface-2, #EAF5EE);
  --rp-text: var(--text, #0E2417);
  --rp-muted: var(--muted, #5B7265);
  --rp-line: var(--line, #DCE9E0);
}

/* muncul saat discroll (kelas cb-rp-in ditambahkan oleh JS; tanpa JS tetap terlihat) */
.cb-rp-js .cb-rp-reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.cb-rp-js .cb-rp-reveal.cb-rp-in { opacity: 1; transform: none; }

/* ---------- CTA ---------- */
.cb-rp-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin: 28px 0; padding: 22px 24px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #2FB463, #00873E 50%, #00471F);
  box-shadow: 0 14px 34px rgba(0, 71, 31, .22); position: relative; overflow: hidden;
}
.cb-rp-cta::after { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 232, 107, .45), transparent 65%); animation: cb-rp-float 6s ease-in-out infinite; }
.cb-rp-cta-text { position: relative; z-index: 1; flex: 1 1 260px; }
.cb-rp-cta .cb-rp-cta-title { margin: 0; font-weight: 800; font-size: 1.12em; line-height: 1.3; color: #fff; }
.cb-rp-cta .cb-rp-cta-sub { margin: 4px 0 0; opacity: .9; font-size: .95em; color: #fff; }
.cb-rp-btn {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #00471F !important; text-decoration: none !important; font-weight: 800;
  padding: 13px 22px; border-radius: 999px; white-space: nowrap; transition: transform .2s ease, box-shadow .2s ease;
  animation: cb-rp-pulse 2.4s ease-in-out infinite;
}
.cb-rp-btn:hover, .cb-rp-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .2); }
.cb-rp-play { width: 0; height: 0; border-left: 12px solid #00873E; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
@keyframes cb-rp-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(184, 232, 107, .7); } 50% { box-shadow: 0 0 0 10px rgba(184, 232, 107, 0); } }
@keyframes cb-rp-float { 50% { transform: translate(-18px, 22px); } }

/* ---------- Chaos → tiket ---------- */
.cb-rp-chaos { margin: 28px 0; }
.cb-rp-chaos-stage { position: relative; height: 320px; border-radius: 20px; background: #0E2417; overflow: hidden; }
.cb-rp-file {
  position: absolute; left: 50%; top: 50%; width: 260px; margin: -26px 0 0 -130px; padding: 12px 14px;
  border-radius: 14px; background: #fff; color: #0E2417; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); opacity: 0;
}
.cb-rp-file span { flex: none; font-size: 10px; font-weight: 900; color: #fff; background: #2B6CB0; border-radius: 6px; padding: 8px 6px; }
.cb-rp-file span.cb-rp-pdf { background: #C53030; }
.cb-rp-ticket {
  position: absolute; left: 50%; top: 50%; width: 300px; margin: -62px 0 0 -150px; padding: 18px 20px;
  border-radius: 18px; background: #fff; color: #0E2417; border: 3px solid #2FB463; opacity: 0; transform: scale(.6);
}
.cb-rp-ticket p { margin: 0; }
.cb-rp-tno { font-size: 12px; font-weight: 800; color: #00873E; letter-spacing: .04em; }
.cb-rp-tt { font-size: 17px; font-weight: 800; margin-top: 4px !important; }
.cb-rp-tmeta { font-size: 13px; color: #5B7265; margin-top: 8px !important; }
.cb-rp-in .cb-rp-f1 { animation: cb-rp-f1 6s ease-in-out infinite; }
.cb-rp-in .cb-rp-f2 { animation: cb-rp-f2 6s ease-in-out infinite; }
.cb-rp-in .cb-rp-f3 { animation: cb-rp-f3 6s ease-in-out infinite; }
.cb-rp-in .cb-rp-f4 { animation: cb-rp-f4 6s ease-in-out infinite; }
.cb-rp-in .cb-rp-ticket { animation: cb-rp-ticket 6s ease-in-out infinite; }
@keyframes cb-rp-f1 { 0% { opacity: 0; transform: translate(-120px, -160px) rotate(-14deg); } 10%, 45% { opacity: 1; transform: translate(-90px, -95px) rotate(-8deg); } 58% { opacity: 0; transform: scale(.3); } 100% { opacity: 0; } }
@keyframes cb-rp-f2 { 0%, 6% { opacity: 0; transform: translate(160px, -140px) rotate(12deg); } 16%, 45% { opacity: 1; transform: translate(80px, -30px) rotate(6deg); } 58% { opacity: 0; transform: scale(.3); } 100% { opacity: 0; } }
@keyframes cb-rp-f3 { 0%, 12% { opacity: 0; transform: translate(-160px, 160px) rotate(-10deg); } 22%, 45% { opacity: 1; transform: translate(-70px, 40px) rotate(-4deg); } 58% { opacity: 0; transform: scale(.3); } 100% { opacity: 0; } }
@keyframes cb-rp-f4 { 0%, 18% { opacity: 0; transform: translate(160px, 180px) rotate(14deg); } 28%, 45% { opacity: 1; transform: translate(60px, 100px) rotate(8deg); } 58% { opacity: 0; transform: scale(.3); } 100% { opacity: 0; } }
@keyframes cb-rp-ticket { 0%, 52% { opacity: 0; transform: scale(.6); } 62% { opacity: 1; transform: scale(1.06); } 68%, 92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.95); } }

/* ---------- Langkah ---------- */
.cb-rp-steps { list-style: none; counter-reset: cbrp; padding: 0 !important; margin: 24px 0; position: relative; }
.cb-rp-steps::before { content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 3px; background: var(--rp-line); border-radius: 3px; }
.cb-rp-steps li { counter-increment: cbrp; position: relative; padding: 4px 0 18px 60px; margin: 0 !important; }
.cb-rp-steps li::before {
  content: counter(cbrp); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--rp-g);
  box-shadow: 0 0 0 5px var(--rp-soft); transform: scale(.4); opacity: 0;
}
.cb-rp-js .cb-rp-steps li { opacity: 0; transform: translateX(16px); transition: opacity .5s ease, transform .5s ease; }
.cb-rp-js .cb-rp-steps.cb-rp-in li { opacity: 1; transform: none; }
.cb-rp-in li::before { animation: cb-rp-dot .5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.cb-rp-steps li:nth-child(2), .cb-rp-steps li:nth-child(2)::before { transition-delay: .15s; animation-delay: .15s; }
.cb-rp-steps li:nth-child(3), .cb-rp-steps li:nth-child(3)::before { transition-delay: .3s; animation-delay: .3s; }
.cb-rp-steps li:nth-child(4), .cb-rp-steps li:nth-child(4)::before { transition-delay: .45s; animation-delay: .45s; }
.cb-rp-steps li:nth-child(5), .cb-rp-steps li:nth-child(5)::before { transition-delay: .6s; animation-delay: .6s; }
.cb-rp-steps li:nth-child(6), .cb-rp-steps li:nth-child(6)::before { transition-delay: .75s; animation-delay: .75s; }
@keyframes cb-rp-dot { to { transform: scale(1); opacity: 1; } }
html:not(.cb-rp-js) .cb-rp-steps li::before { transform: none; opacity: 1; }

/* ---------- Kumpul tugas ---------- */
.cb-rp-collect { margin: 24px 0; padding: 22px; border-radius: 20px; background: #00471F; color: #fff; }
.cb-rp-collect .cb-rp-link { margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; background: #0E2417; color: #B8E86B; font-family: ui-monospace, monospace; font-weight: 700; }
.cb-rp-list { list-style: none; margin: 0 !important; padding: 16px !important; border-radius: 16px; background: #fff; color: #0E2417; min-height: 210px; }
.cb-rp-list li { display: flex; align-items: center; gap: 12px; margin: 0 0 10px !important; font-weight: 700; }
.cb-rp-list li span { width: 30px; height: 30px; flex: none; border-radius: 50%; background: #00873E; color: #fff; display: grid; place-items: center; font-size: 15px; }
.cb-rp-list li em { margin-left: auto; font-style: normal; font-size: 12px; color: #5B7265; }
.cb-rp-js .cb-rp-list li { opacity: 0; transform: translateX(30px); transition: opacity .45s ease, transform .45s ease; }
.cb-rp-js .cb-rp-collect.cb-rp-in .cb-rp-list li { opacity: 1; transform: none; }
.cb-rp-collect.cb-rp-in .cb-rp-list li:nth-child(1) { transition-delay: .3s; }
.cb-rp-collect.cb-rp-in .cb-rp-list li:nth-child(2) { transition-delay: .65s; }
.cb-rp-collect.cb-rp-in .cb-rp-list li:nth-child(3) { transition-delay: 1s; }
.cb-rp-collect.cb-rp-in .cb-rp-list li:nth-child(4) { transition-delay: 1.35s; }
.cb-rp-collect .cb-rp-count { margin: 14px 0 0; text-align: center; font-size: 1.3em; font-weight: 800; color: #fff; }
.cb-rp-count strong { color: #B8E86B; display: inline-block; min-width: 2ch; }

/* ---------- Alur file ---------- */
.cb-rp-flow { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 0; margin: 24px 0; padding: 26px 18px; border-radius: 20px; background: linear-gradient(170deg, #00471F, #0E2417); color: #fff; min-height: 170px; }
.cb-rp-node { position: relative; width: 84px; height: 118px; border-radius: 20px; border: 5px solid #fff; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 13px; line-height: 1.2; }
.cb-rp-node.cb-rp-server { border-style: dashed; border-color: rgba(255, 255, 255, .45); width: 96px; }
.cb-rp-node.cb-rp-dest { border-color: #B8E86B; color: #B8E86B; }
.cb-rp-del { position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%) scale(.5); white-space: nowrap; color: #B8E86B; font-weight: 900; font-size: 13px; opacity: 0; }
.cb-rp-track { position: relative; height: 4px; margin: 0 8px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .35) 0 8px, transparent 8px 16px); }
.cb-rp-packet { position: absolute; top: -17px; left: 0; width: 34px; height: 38px; border-radius: 8px; background: #C53030; font-size: 10px; font-weight: 900; display: grid; place-items: center; opacity: 0; }
.cb-rp-in .cb-rp-packet { animation: cb-rp-hop1 5s ease-in-out infinite; }
.cb-rp-in .cb-rp-packet2 { animation: cb-rp-hop2 5s ease-in-out infinite; }
.cb-rp-in .cb-rp-del { animation: cb-rp-del 5s ease-in-out infinite; }
@keyframes cb-rp-hop1 { 0% { left: 0; opacity: 0; } 8% { opacity: 1; } 34% { left: calc(100% - 34px); opacity: 1; } 40%, 100% { left: calc(100% - 34px); opacity: 0; } }
@keyframes cb-rp-hop2 { 0%, 40% { left: 0; opacity: 0; } 46% { opacity: 1; } 72% { left: calc(100% - 34px); opacity: 1; } 78%, 100% { left: calc(100% - 34px); opacity: 0; } }
@keyframes cb-rp-del { 0%, 74% { opacity: 0; transform: translateX(-50%) scale(.5); } 80%, 94% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; } }

@media (max-width: 560px) {
  .cb-rp-chaos-stage { height: 300px; }
  .cb-rp-file { width: 220px; margin-left: -110px; font-size: 12.5px; }
  .cb-rp-flow { padding: 22px 10px; }
  .cb-rp-node { width: 62px; height: 92px; font-size: 11px; border-width: 4px; border-radius: 16px; }
  .cb-rp-node.cb-rp-server { width: 70px; }
  .cb-rp-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cb-rp-cta::after, .cb-rp-btn, .cb-rp-in .cb-rp-file, .cb-rp-in .cb-rp-packet, .cb-rp-in .cb-rp-packet2, .cb-rp-in .cb-rp-del { animation: none !important; }
  .cb-rp-js .cb-rp-reveal, .cb-rp-js .cb-rp-steps li, .cb-rp-js .cb-rp-list li { opacity: 1 !important; transform: none !important; transition: none !important; }
  .cb-rp-steps li::before { animation: none !important; opacity: 1; transform: none; }
  .cb-rp-file { display: none; }
  .cb-rp-in .cb-rp-ticket, .cb-rp-ticket { animation: none !important; opacity: 1; transform: none; }
  .cb-rp-del { opacity: 1; transform: translateX(-50%); }
}

/* tanpa JavaScript: tampilkan hasil akhirnya saja */
html:not(.cb-rp-js) .cb-rp-ticket { opacity: 1; transform: none; }
html:not(.cb-rp-js) .cb-rp-file { display: none; }

.cb-rp-cta *, .cb-rp-chaos *, .cb-rp-collect *, .cb-rp-flow *, .cb-rp-steps *, .cb-rp-cta, .cb-rp-chaos, .cb-rp-collect, .cb-rp-flow { box-sizing: border-box; }
@media (max-width: 560px) { .cb-rp-ticket { width: 280px; margin-left: -140px; } }
