/* =========================================================
   CLAY DEV — Neo-brutalism cartoon design system
   ========================================================= */

:root {
  --cream: #FFF6E5;
  --paper: #FFFDF7;
  --ink: #111111;
  --orange: #FF7A2F;
  --pink: #FF3E9A;
  --teal: #3FC7C2;
  --yellow: #FFD23F;
  --mint: #8FE388;
  --purple: #8B5CF6;
  --blue: #4D9BFF;

  --border: 4px;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-lg: 10px 10px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);

  --font-head: 'Fredoka', 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;

  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  line-height: 1.55;
  overflow-x: hidden;
}

/* bg-pattern.webp adalah komposisi bingkai penuh (blob di tepi, tengah kosong),
   jadi dipakai sekali sebagai layer tetap: cover + no-repeat, JANGAN di-tile.
   Layer fixed ini konsisten di mobile (tak bergantung background-attachment). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 246, 229, 0.22), rgba(255, 246, 229, 0.22)),
    url('../img/bg-pattern.webp') center center / cover no-repeat;
  pointer-events: none;
}

h1, h2, h3, .head { font-family: var(--font-head); font-weight: 700; line-height: 1.05; margin: 0; }

a { color: inherit; }

img { max-width: 100%; display: block; }

.container { width: min(100% - 40px, var(--maxw)); margin-inline: auto; position: relative; z-index: 1; }

/* ---------- Reusable brutalist primitives ---------- */
.card {
  background: var(--paper);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .82rem;
  box-shadow: var(--shadow-sm);
}

.btn {
  --btn-bg: var(--yellow);
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--btn-bg);
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  padding: 14px 26px;
  box-shadow: var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translate(3px, 3px); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.btn--pink { --btn-bg: var(--pink); color: #fff; }
.btn--teal { --btn-bg: var(--teal); }
.btn--orange { --btn-bg: var(--orange); color: #fff; }
.btn--ghost { --btn-bg: var(--paper); }
.btn--block { width: 100%; }
.btn--lg { font-size: 1.2rem; padding: 18px 30px; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: var(--border) solid var(--ink);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__logo {
  width: 52px; height: 52px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--teal);
  box-shadow: var(--shadow-sm);
  object-fit: contain;
  padding: 2px;
}
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: -.5px; }
.brand__name b { color: var(--orange); }
.nav__links { display: flex; align-items: center; gap: 22px; }
.nav__links a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav__links a:hover { color: var(--pink); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; position: relative; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.hero__title { font-size: clamp(2.4rem, 6vw, 4.3rem); letter-spacing: -1.5px; }
.hero__title .hl { position: relative; color: var(--pink); white-space: nowrap; }
.hero__title .hl::after {
  content: ''; position: absolute; left: -4px; right: -4px; bottom: 4px; height: 30%;
  background: var(--yellow); z-index: -1; transform: rotate(-1.5deg); border-radius: 4px;
}
.hero__sub { font-size: 1.12rem; max-width: 46ch; margin: 20px 0 8px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero__stats { display: flex; gap: 18px; margin-top: 30px; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 12px; }
.stat__ic {
  flex: none; width: 52px; height: 52px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: var(--paper); box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
}
.stat__ic img { width: 30px; height: 30px; }
.stat__txt b { font-family: var(--font-head); font-size: 1.55rem; display: block; line-height: 1; }
.stat__txt span { font-size: .82rem; opacity: .8; }

.hero__art { position: relative; display: grid; place-items: center; }
.hero__art img.hero-illu {
  width: 100%; max-width: 460px;
  filter: drop-shadow(10px 12px 0 rgba(17,17,17,.18));
}
.hero__badge {
  position: absolute;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 8px 12px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .85rem;
  display: flex; align-items: center; gap: 8px;
}
.hero__badge img { width: 26px; height: 26px; }
.hero__badge--1 { top: 6%; left: -2%; background: var(--mint); }
.hero__badge--2 { bottom: 10%; right: -2%; background: var(--blue); color: #fff; }

/* floating deco stickers */
.deco { position: absolute; z-index: 0; pointer-events: none; }
.deco img { width: 100%; height: 100%; }

/* ---------- Section headings ---------- */
.section { padding: 46px 0; position: relative; }
.section__head { text-align: center; margin-bottom: 34px; }
.section__title { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -1px; }
.section__desc { max-width: 52ch; margin: 12px auto 0; opacity: .85; }

/* ---------- About / features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { padding: 26px 22px; text-align: left; transition: transform .12s ease; }
.feature:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); }
.feature__icon {
  width: 66px; height: 66px; border-radius: 16px; border: 3px solid var(--ink);
  display: grid; place-items: center; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.feature__icon img { width: 38px; height: 38px; }
.feature h3 { font-size: 1.3rem; margin-bottom: 8px; }
.feature p { margin: 0; font-size: .96rem; opacity: .85; }
.feature:nth-child(1) .feature__icon { background: var(--yellow); }
.feature:nth-child(2) .feature__icon { background: var(--pink); }
.feature:nth-child(3) .feature__icon { background: var(--teal); }

/* ---------- Donate section ---------- */
.donate { position: relative; }
.donate__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: stretch; }

.info-card { padding: 30px 28px; display: flex; flex-direction: column; gap: 18px; background: var(--purple); color: #fff; position: relative; overflow: hidden; }
.info-card__mascot { width: 92px; filter: drop-shadow(4px 5px 0 rgba(0,0,0,.28)); }
.info-card h3 { font-size: 1.55rem; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1rem; }
.steps li span {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  border: 3px solid var(--ink); background: var(--yellow); color: var(--ink);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700;
  box-shadow: 3px 3px 0 var(--ink);
}

.pay-methods__label { font-family: var(--font-head); font-weight: 600; font-size: .82rem; letter-spacing: 1px; text-transform: uppercase; opacity: .85; margin: 0 0 10px; }
.pay-methods__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-methods__chips span {
  background: rgba(255,255,255,.16);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-head); font-weight: 600; font-size: .82rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.info-quote {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255,255,255,.14);
  border: 3px solid var(--ink); border-radius: var(--radius-sm);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.info-quote img { width: 26px; height: 26px; flex: none; margin-top: 2px; }
.info-quote p { margin: 0; font-size: .95rem; font-style: italic; line-height: 1.5; }

.info-badge {
  margin-top: auto; align-self: flex-start;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: 9px 16px; font-family: var(--font-head); font-weight: 600; font-size: .85rem;
  box-shadow: var(--shadow-sm);
}

/* form */
.form-card { padding: 28px; }
.form-card h3 { font-size: 1.5rem; margin-bottom: 6px; }
.form-card .lead { opacity: .8; margin: 0 0 18px; font-size: .95rem; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-family: var(--font-head); font-weight: 600; margin-bottom: 8px; font-size: .95rem; }

.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preset {
  cursor: pointer; text-align: center; padding: 14px 6px;
  border: 3px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--paper); font-family: var(--font-head); font-weight: 600;
  box-shadow: var(--shadow-sm); transition: transform .08s ease, background .12s ease;
  font-size: .98rem;
}
.preset:hover { transform: translate(-2px,-2px); }
.preset.is-active { background: var(--yellow); transform: translate(-2px,-2px); box-shadow: var(--shadow); }

.amount-input { position: relative; }
.amount-input .rp {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; pointer-events: none;
}
.input, .textarea {
  width: 100%; font-family: var(--font-body); font-size: 1.05rem;
  border: 3px solid var(--ink); border-radius: var(--radius-sm);
  padding: 14px 16px; background: var(--paper); box-shadow: var(--shadow-sm);
  transition: box-shadow .1s ease, transform .1s ease;
}
.input:focus, .textarea:focus { outline: none; box-shadow: var(--shadow); transform: translate(-1px,-1px); }
.amount-input .input { padding-left: 44px; font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; }
.textarea { resize: vertical; min-height: 72px; }

.form-error {
  display: none; margin: 10px 0 0; padding: 10px 14px;
  border: 3px solid var(--ink); border-radius: var(--radius-sm);
  background: #FFDADA; font-weight: 600; font-size: .9rem;
}
.form-error.show { display: block; }

.form-note { font-size: .8rem; opacity: .7; margin-top: 12px; text-align: center; }

/* ---------- Donor wall (list Nama | Donasi | Pesan) ---------- */
.donor-wall {
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.donor-head {
  display: grid;
  grid-template-columns: 1.3fr .8fr 2fr;
  gap: 16px;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.donor-scroll {
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) transparent;
}
.donor-scroll::-webkit-scrollbar { width: 12px; }
.donor-scroll::-webkit-scrollbar-track { background: #EFE7D2; }
.donor-scroll::-webkit-scrollbar-thumb {
  background: var(--purple); border: 2px solid var(--ink); border-radius: 999px;
}
.donor-wall__hint {
  text-align: center; font-size: .85rem; opacity: .7; margin: 0;
  padding: 12px; font-weight: 600; border-top: 3px solid var(--ink); background: #FBF3DE;
}

.donors { list-style: none; margin: 0; padding: 0; }
.donor {
  display: grid;
  grid-template-columns: 1.3fr .8fr 2fr;
  gap: 16px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 2px dashed rgba(17, 17, 17, .18);
  transition: background .12s ease, transform .12s ease;
}
.donor:nth-child(even) { background: #FBF3DE; }
.donor:hover { background: var(--yellow); }
.donor--new {
  animation: flashRow 1.6s ease;
}
@keyframes flashRow {
  0% { background: var(--mint); transform: scale(1.01); }
  100% { background: transparent; transform: scale(1); }
}

.dcol { min-width: 0; }
.dcol--name { display: flex; align-items: center; gap: 12px; }
.donor__avatar {
  flex: none; width: 38px; height: 38px; border: 3px solid var(--ink); border-radius: 11px;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: .9rem;
  box-shadow: 2px 2px 0 var(--ink);
}
.donor__avatar[data-c="0"] { background: var(--yellow); }
.donor__avatar[data-c="1"] { background: var(--pink); color: #fff; }
.donor__avatar[data-c="2"] { background: var(--teal); }
.donor__avatar[data-c="3"] { background: var(--purple); color: #fff; }
.donor__name { font-family: var(--font-head); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donor__amt { font-family: var(--font-head); font-weight: 700; color: var(--orange); font-size: 1.05rem; }
.donor__msg { font-size: .92rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donor__msg .muted { opacity: .5; }

/* ---------- Footer ---------- */
.footer { border-top: var(--border) solid var(--ink); background: var(--paper); margin-top: 20px; }
.footer__inner { padding: 30px 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer small { opacity: .75; }

/* ---------- Payment modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(17,17,17,.55);
  backdrop-filter: blur(3px);
}
.modal.show { display: flex; animation: fadeIn .2s ease; }
.modal__box {
  width: min(100%, 460px); max-height: 92vh; overflow-y: auto;
  background: var(--paper); border: var(--border) solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 26px; position: relative; animation: popIn .28s cubic-bezier(.2,1.3,.4,1);
}
.modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border: 3px solid var(--ink); border-radius: 12px;
  background: var(--pink); color: #fff; cursor: pointer; font-size: 1.2rem;
  box-shadow: var(--shadow-sm); font-family: var(--font-head); line-height: 1;
}
.modal__close:hover { transform: translate(-1px,-1px); }
.modal__title { font-size: 1.5rem; text-align: center; margin-bottom: 4px; }
.modal__ref { text-align: center; font-size: .85rem; opacity: .75; margin-bottom: 16px; }

.qris-box { text-align: center; }
.qris-frame {
  display: inline-block; padding: 12px; background: #fff;
  border: 3px solid var(--ink); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.qris-frame img { width: 240px; height: 240px; object-fit: contain; }
.pay-amount {
  margin: 18px 0 6px; font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; color: var(--orange);
}
.pay-hint { font-size: .85rem; opacity: .8; margin: 0 0 14px; }
.pay-hint b { color: var(--pink); }
.countdown {
  display: inline-flex; align-items: center; gap: 8px;
  border: 3px solid var(--ink); border-radius: 999px; padding: 8px 16px;
  background: var(--yellow); font-family: var(--font-head); font-weight: 700; box-shadow: var(--shadow-sm);
}
.countdown.is-danger { background: #FFB3B3; }
.pay-status { margin-top: 16px; font-size: .9rem; display: flex; align-items: center; justify-content: center; gap: 8px; opacity: .85; }
.dot-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--teal); border: 2px solid var(--ink); animation: pulse 1s infinite; }

/* loading + success + failed states */
.state { display: none; text-align: center; }
.state.show { display: block; animation: fadeIn .25s ease; }
.spinner {
  width: 60px; height: 60px; margin: 24px auto;
  border: 6px solid var(--ink); border-top-color: var(--orange);
  border-radius: 50%; animation: spin .9s linear infinite;
}
.success-emoji, .fail-emoji { font-size: 4rem; margin: 6px 0; display: inline-block; animation: popIn .5s cubic-bezier(.2,1.5,.4,1); }
.success-check {
  width: 92px; height: 92px; margin: 8px auto 12px; border-radius: 50%;
  background: var(--mint); border: 4px solid var(--ink); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); animation: popIn .5s cubic-bezier(.2,1.5,.4,1);
}
.success-trx { font-size: .85rem; opacity: .8; margin-top: 8px; }
.success-trx code { background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; padding: 2px 8px; font-weight: 700; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; display: none; }
.confetti.show { display: block; }
.confetti i {
  position: absolute; top: -20px; width: 12px; height: 16px;
  border: 2px solid var(--ink); border-radius: 3px;
  animation: fall linear forwards;
}

/* fireworks (kembang api) */
.fireworks { position: fixed; inset: 0; pointer-events: none; z-index: 195; display: none; }
.fireworks.show { display: block; }

/* ---------- Animations ---------- */
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(2deg); } }
@keyframes floatSlow { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }
@keyframes wiggle { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(.8); opacity: .6; } 50% { transform: scale(1.2); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }

.anim-float { animation: float 5s ease-in-out infinite; }
.anim-float-slow { animation: floatSlow 7s ease-in-out infinite; }
.anim-wiggle { animation: wiggle 3.5s ease-in-out infinite; transform-origin: center; }

/* scroll reveal — default VISIBLE so konten tak pernah hilang bila JS gagal.
   JS menambah .is-armed (sembunyikan) lalu .in (animasikan masuk). */
.reveal { opacity: 1; }
.reveal.is-armed { opacity: 0; }
.reveal.is-armed.in { animation: riseIn .6s ease forwards; }

/* ---------- Confirm dialog (batalkan donasi) ---------- */
.confirm {
  position: fixed; inset: 0; z-index: 150;
  display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(17,17,17,.5); backdrop-filter: blur(2px);
}
.confirm.show { display: flex; animation: fadeIn .2s ease; }
.confirm__box {
  width: min(100%, 380px); text-align: center; padding: 28px 24px;
  background: var(--paper); border: var(--border) solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: popIn .28s cubic-bezier(.2,1.3,.4,1);
}
.confirm__emoji { font-size: 3rem; }
.confirm__title { font-size: 1.4rem; margin: 6px 0; }
.confirm__desc { font-size: .92rem; opacity: .8; margin: 0 0 20px; }
.confirm__actions { display: flex; gap: 12px; }
.confirm__actions .btn { flex: 1; font-size: .95rem; padding: 12px 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__sub { margin-inline: auto; }
  .hero__cta, .hero__stats { justify-content: center; }
  .hero__art { order: -1; }
  .features { grid-template-columns: 1fr; }
  .donate__grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nav__links { display: none; }
  .hero { padding: 34px 0 20px; }
  .hero__stats { gap: 14px; }
  .stat__txt b { font-size: 1.3rem; }
  .presets { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { flex-direction: column; text-align: center; }
  .qris-frame img { width: 200px; height: 200px; }
  .modal__box { padding: 20px; }
  .confirm__actions { flex-direction: column-reverse; }

  /* Donor list: susun vertikal biar enak di layar kecil */
  .donor-head { display: none; }
  .donor {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name amt" "msg msg";
    gap: 6px 12px;
    padding: 14px 18px;
  }
  .dcol--name { grid-area: name; }
  .dcol--amt { grid-area: amt; justify-self: end; }
  .dcol--msg { grid-area: msg; white-space: normal; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal.is-armed { opacity: 1; }
}
