/* Album Polaroid: meja bertaplak linen, foto cetak, kartu indeks, tulisan tangan. */
:root {
  --ap-linen: #e7dfd0;
  --ap-linen-gelap: #d9cfbc;
  --ap-teks: #3b342c;
  --ap-pudar: #6f665a;
  --ap-tinta: #27375e;
  --ap-cap: #b4442f;
  --ap-putih: #fbfaf6;
  --ap-indeks: #fdfcf7;
  --ap-garis: rgb(80 120 170 / 0.22);
  --ap-kraft: #c89f72;
  --ap-tangan: 'Caveat', 'Segoe Print', cursive;
  --ap-ketik: 'Special Elite', 'Courier New', monospace;
  --ap-badan: 'Karla', system-ui, sans-serif;
  --ap-bayang:
    0 1px 1px rgb(60 45 30 / 0.18), 0 6px 14px -4px rgb(60 45 30 / 0.28),
    0 18px 30px -18px rgb(60 45 30 / 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  --ub-latar: var(--ap-linen);
  -webkit-text-size-adjust: 100%;
}

body.ap {
  margin: 0;
  color: var(--ap-teks);
  font: 400 17px/1.6 var(--ap-badan);
  background:
    /* benang lungsin dan pakan: dua lapis garis halus yang saling silang, tampak seperti anyaman linen */
    repeating-linear-gradient(0deg, rgb(92 74 48 / 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgb(92 74 48 / 0.03) 0 1px, transparent 1px 3px),
    url(aset/linen.svg) 0 0 / 320px 320px,
    /* cahaya lampu meja dari atas, pinggir meja lebih gelap */
    radial-gradient(130% 90% at 50% 0%, #f1eadd 0%, var(--ap-linen) 50%, var(--ap-linen-gelap) 100%) fixed;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

.ap-tangan {
  font-family: var(--ap-tangan);
  font-weight: 500;
  color: var(--ap-tinta);
  line-height: 1.05;
}

.ap-ketik {
  font-family: var(--ap-ketik);
  letter-spacing: 0.02em;
}

.ap-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ap-pudar);
}

.ap-kecil {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ap-pudar);
}

.ap-tautan {
  font-family: var(--ap-ketik);
  font-size: 14px;
  color: var(--ap-tinta);
  text-underline-offset: 3px;
}

/* ---------- Bahan: polaroid, kartu catatan, kartu indeks, tape ---------- */

.ap-polaroid,
.ap-catatan {
  position: relative;
  background: var(--ap-putih) url(aset/kertas.svg);
  box-shadow: var(--ap-bayang);
  transform: rotate(var(--r, 0deg));
}

.ap-polaroid {
  padding: clamp(9px, 2.6cqw, 16px) clamp(9px, 2.6cqw, 16px) 0;
}

.ap-polaroid__foto,
.ap-polaroid > .ub-foto-perbesar {
  display: block;
  aspect-ratio: var(--ap-ar, 1);
  overflow: hidden;
  /* warna kertas foto: foto yang belum termuat atau tanpa latar tidak tampil sebagai kotak hitam */
  background: #e9e2d3;
}

.ap-polaroid > .ub-foto-perbesar .ub-foto {
  display: block;
  height: 100%;
}

.ap-polaroid__foto img {
  filter: saturate(0.88) contrast(1.04) sepia(0.08);
}

.ap-polaroid__tulis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4em;
  padding: 0.3em 0.4em 0.5em;
  font-size: clamp(22px, 5.6cqw, 30px);
  text-align: center;
}

.ap-catatan {
  display: grid;
  place-items: center;
  aspect-ratio: 0.86;
  padding: 44px 22px 30px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 27px, var(--ap-garis) 27px 28px) 0 22px,
    var(--ap-indeks) url(aset/kertas.svg);
  text-align: center;
}

.ap-catatan--kecil {
  aspect-ratio: auto;
  padding: 34px 22px 26px;
}

.ap-catatan__isi {
  font-family: var(--ap-tangan);
  color: var(--ap-tinta);
  font-size: 26px;
  line-height: 1.1;
}

.ap-catatan__besar {
  font-size: clamp(34px, 9cqw, 52px);
}

.ap-indeks {
  position: relative;
  padding: 26px 22px 22px 34px;
  background:
    linear-gradient(to right, transparent 22px, rgb(200 80 80 / 0.35) 22px 23px, transparent 23px),
    repeating-linear-gradient(to bottom, transparent 0 25px, var(--ap-garis) 25px 26px) 0 50px,
    var(--ap-indeks) url(aset/kertas.svg);
  box-shadow: var(--ap-bayang);
  transform: rotate(var(--r, 0deg));
}

.ap-tape {
  position: absolute;
  z-index: 2;
  top: -12px;
  left: 50%;
  width: 92px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgb(232 200 110 / 0.62);
  /* tepi tape bergerigi kecil */
  mask:
    linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent calc(100% - 3px)),
    repeating-linear-gradient(0deg, #000 0 3px, transparent 3px 5px);
  mask-composite: add;
  box-shadow: 0 1px 2px rgb(60 45 30 / 0.12);
}

.ap-tape--merah {
  background: rgb(214 128 116 / 0.58);
  transform: translateX(-50%) rotate(4deg);
}

.ap-tape--hijau {
  background: rgb(134 172 146 / 0.6);
  transform: translateX(-50%) rotate(-5deg);
}

.ap-tombol,
.ap-label-tag,
.ub-tombol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  font: 400 15px/1.2 var(--ap-ketik);
  color: var(--ap-teks);
  text-decoration: none;
  cursor: pointer;
}

.ap-tombol,
.ub-tombol--utama {
  background: var(--ap-tinta);
  color: var(--ap-putih);
  border-radius: 3px;
  box-shadow: 0 3px 0 rgb(20 30 55 / 0.35);
}

.ap-tombol:hover,
.ub-tombol--utama:hover {
  background: #1c2a4b;
}

/* label tag: kartu kecil berlubang tali */
.ap-label-tag {
  position: relative;
  padding-left: 30px;
  background: #f4ead2;
  border-radius: 3px 12px 12px 3px;
  box-shadow: 0 1px 2px rgb(60 45 30 / 0.25);
}

.ap-label-tag::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: #d6c39a;
  box-shadow: inset 0 1px 2px rgb(60 45 30 / 0.45);
}

.ap-label-tag:hover {
  background: #efe0bd;
}

:focus-visible {
  outline: 2px dashed var(--ap-tinta);
  outline-offset: 3px;
}

/* ---------- Sampul: meja ---------- */

.ap-meja {
  position: relative;
  min-height: max(740px, 100svh);
  overflow: hidden;
  isolation: isolate;
}

.ap-meja__item {
  position: absolute;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.js .ap-meja__item,
.js .ap-polos__item {
  cursor: grab;
}

.ap-meja__item.is-pegang,
.ap-polos__item.is-pegang {
  cursor: grabbing;
}

.ap-meja__item.is-pegang,
.ap-polos__item.is-pegang,
.ap-meja__item.is-atas {
  z-index: 10;
}

.ap-meja__item,
.ap-polos__item {
  translate: var(--x, 0) var(--y, 0);
  transition: translate 0.08s linear;
}

.ap-meja__a {
  width: 40cqw;
  max-width: 250px;
  left: -6cqw;
  top: 66px;
  z-index: 1;
}

.ap-meja__b {
  width: 40cqw;
  max-width: 250px;
  right: -7cqw;
  bottom: 130px;
  z-index: 1;
}

.ap-meja__a .ap-polaroid__tulis,
.ap-meja__b .ap-polaroid__tulis {
  font-size: clamp(18px, 4.6cqw, 26px);
  min-height: 2.6em;
}

.ap-meja__utama {
  z-index: 3;
  left: 50%;
  top: 112px;
  width: min(76cqw, 400px);
  margin-left: calc(min(76cqw, 400px) / -2);
}

.ap-meja__utama.ap-catatan {
  aspect-ratio: auto;
  padding: 42px 22px 34px;
}

.ap-meja__utama .ap-polaroid__tulis {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 0.35em 0.2em 0.55em;
}

.ap-nama {
  font-size: calc(clamp(38px, 11cqw, 66px) * var(--ap-skala, 1));
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.ap-nama__dan {
  font-weight: 500;
  color: var(--ap-cap);
}

.ap-meja__tamu {
  z-index: 4;
  left: 5cqw;
  bottom: 74px;
  width: min(61cqw, 300px);
  padding: 22px 16px 18px 32px;
}

.ap-tamu {
  display: block;
  margin: 2px 0 6px;
  font-size: clamp(24px, 6.2cqw, 34px);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ap-cap {
  position: absolute;
  z-index: 5;
  right: 6cqw;
  top: 40px;
  transform: rotate(-11deg);
  padding: 6px 12px;
  border: 3px solid var(--ap-cap);
  border-radius: 6px;
  color: var(--ap-cap);
  font: 400 16px/1 var(--ap-ketik);
  letter-spacing: 0.12em;
  opacity: 0.94;
  mask:
    url(aset/kertas.svg) 0 0 / 120px,
    linear-gradient(#000, #000);
  mask-composite: subtract;
}

.ap-meja__petunjuk {
  position: absolute;
  z-index: 2;
  left: 7cqw;
  bottom: 14px;
  font-size: 22px;
  color: var(--ap-pudar);
  transform: rotate(-3deg);
}

.ap-meja.is-digeser .ap-meja__petunjuk {
  opacity: 0;
  transition: opacity 0.4s;
}

/* Tanpa satu pun foto: bukan "foto yang hilang", tapi tiga kartu catatan berisi hal nyata */
.ap-meja.ap-meja--polos {
  min-height: 0;
  padding: 96px 18px 72px;
}

.ap-polos {
  position: relative;
  display: grid;
  justify-items: center;
  max-width: 980px;
  margin: 0 auto;
}

.ap-polos__item {
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: translate 0.08s linear;
}

.ap-polos__utama {
  z-index: 3;
  width: min(88cqw, 440px);
  aspect-ratio: auto;
  gap: 6px;
  /* ruang bawah untuk stiker "Catat ya" yang menempel di tepi kartu, supaya tidak menutupi tanggal */
  padding: 46px 24px 58px;
}

.ap-polos__tgl {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px dashed var(--ap-garis);
  font-size: clamp(30px, 8.4cqw, 44px);
  font-weight: 700;
  color: var(--ap-cap);
}

.ap-polos__kutip {
  margin-top: 6px;
  max-width: 30ch;
}

.ap-polos__waktu {
  z-index: 4;
  width: min(62cqw, 230px);
  margin: -20px 6cqw 0 auto;
}

.ap-polos__jam {
  font-size: 30px;
  font-weight: 700;
  margin: 2px 0 4px;
}

.ap-polos__tamu {
  z-index: 2;
  width: min(76cqw, 310px);
  margin: -26px auto 0 4cqw;
  padding: 24px 16px 18px 32px;
}


/* Foto jatuh ke meja saat halaman dibuka (hanya bila skrip jalan) */
.ap-gerak .ap-meja__item,
.ap-gerak .ap-polos__item {
  animation: ap-jatuh 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.ap-gerak .ap-meja__b {
  animation-delay: 0.12s;
}

.ap-gerak .ap-meja__utama,
.ap-gerak .ap-polos__utama {
  animation-delay: 0.24s;
}

.ap-gerak .ap-meja__tamu {
  animation-delay: 0.5s;
}

@keyframes ap-jatuh {
  from {
    opacity: 0;
    transform: rotate(calc(var(--r, 0deg) * 3)) scale(1.18) translateY(-30px);
  }
}

/* ---------- Isi ---------- */

.ap-isi {
  position: relative;
}

.ap-bagian {
  padding: 60px 20px;
  max-width: 1180px;
  margin: 0 auto;
}

.ap-judul {
  margin-bottom: 36px;
  font-size: clamp(40px, 10cqw, 64px);
  font-weight: 700;
  text-align: center;
  transform: rotate(-2deg);
}

.ap-tengah {
  margin-top: 36px;
  text-align: center;
}

/* Salam: selembar kertas sobekan */
.ap-salam {
  padding-top: 40px;
}

.ap-kertas {
  max-width: 620px;
  margin: 0 auto;
  padding: 34px 28px 30px;
  background: var(--ap-indeks) url(aset/kertas.svg);
  box-shadow: var(--ap-bayang);
  transform: rotate(var(--r, 0deg));
  /* tepi bawah sobek */
  clip-path: polygon(
    0 0,
    100% 0,
    100% 96%,
    94% 99%,
    88% 96.5%,
    81% 99.5%,
    73% 97%,
    66% 99%,
    58% 96%,
    50% 99.5%,
    43% 97%,
    35% 99%,
    27% 96.5%,
    19% 99.5%,
    11% 97%,
    5% 99%,
    0 96.5%
  );
}

.ap-salam__teks {
  font-size: 18px;
  line-height: 1.7;
}

.ap-salam__kutip {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed rgb(60 45 30 / 0.25);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ap-pudar);
}

/* Mempelai */
.ap-mempelai__dua {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.ap-mempelai__dan {
  font-size: 72px;
  color: var(--ap-cap);
}

.ap-orang {
  display: grid;
  justify-items: center;
  width: min(100%, 340px);
}

.ap-orang__foto {
  width: 78%;
  z-index: 1;
}

.ap-orang__kartu {
  width: 100%;
  margin-top: -18px;
  padding-top: 30px;
}

.ap-orang--polos .ap-orang__kartu {
  margin-top: 0;
  padding-top: 30px;
}

.ap-orang__nama {
  margin: 6px 0 4px;
  font: 600 21px/1.25 var(--ap-badan);
}

.ap-orang__asal {
  font-size: 15px;
  color: var(--ap-pudar);
  margin-bottom: 8px;
}

/* Rol: tumpukan polaroid */
.ap-rol__petunjuk {
  text-align: center;
  margin: -22px 0 26px;
}

.ap-js-saja {
  display: none;
}

/* kontrol yang hanya bekerja dengan skrip */
.no-js .ap-js {
  display: none;
}

.ap-tumpuk--aktif ~ * .ap-js-saja,
.js .ap-js-saja {
  display: inline;
}

.js .ap-nojs-saja {
  display: none;
}

/* tanpa skrip: kolase berjajar */
.ap-tumpuk {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 26px 18px;
  outline-offset: 12px;
}

.ap-tumpuk__kartu {
  width: min(42cqw, 230px);
}

.ap-tumpuk__kartu .ap-polaroid__tulis {
  font-size: 20px;
  min-height: 2.4em;
  color: var(--ap-pudar);
}

/* dengan skrip: satu tumpukan, kartu teratas bisa dilempar */
.ap-tumpuk.ap-tumpuk--aktif {
  display: grid;
  place-items: center;
  height: min(124cqw, 540px);
  margin: 0 auto;
  touch-action: pan-y;
}

.ap-tumpuk--aktif .ap-tumpuk__kartu {
  grid-area: 1 / 1;
  width: min(74cqw, 380px);
  /* semua gerak lewat properti terpisah supaya `transform: rotate(--r)` bawaan kartu tetap jadi sudut dasarnya */
  translate: var(--dx, 0px) var(--dy, 0px);
  rotate: var(--dr, 0deg);
  scale: var(--ds, 1);
  transition:
    translate 0.4s cubic-bezier(0.3, 0.8, 0.3, 1),
    rotate 0.4s cubic-bezier(0.3, 0.8, 0.3, 1),
    scale 0.4s cubic-bezier(0.3, 0.8, 0.3, 1),
    opacity 0.25s;
  user-select: none;
  -webkit-user-select: none;
}

.ap-tumpuk--aktif .ap-tumpuk__kartu.is-jauh {
  display: none;
}

.ap-tumpuk--aktif .ap-tumpuk__kartu.is-teratas {
  cursor: grab;
  will-change: translate, rotate;
  /* kartu teratas sedikit terangkat dari tumpukan */
  box-shadow:
    0 1px 1px rgb(60 45 30 / 0.2),
    0 12px 22px -6px rgb(60 45 30 / 0.34),
    0 28px 40px -22px rgb(60 45 30 / 0.45);
}

.ap-tumpuk--aktif .ap-tumpuk__kartu.is-tarik {
  transition: none;
  cursor: grabbing;
  scale: 1.03;
}

.ap-tumpuk--aktif .ap-tumpuk__kartu.is-terbang {
  transition:
    translate 0.34s cubic-bezier(0.15, 0.6, 0.4, 1),
    rotate 0.34s cubic-bezier(0.15, 0.6, 0.4, 1),
    opacity 0.34s ease-in;
}

/* pindah ke dasar tumpukan / masuk dari samping tanpa animasi */
.ap-tumpuk--aktif .ap-tumpuk__kartu.is-balik {
  transition: none;
}

.ap-tumpuk--aktif .ap-tumpuk__kartu img {
  pointer-events: none;
  -webkit-user-drag: none;
}

/* kolase: semua foto sekaligus (pilihan untuk banyak foto) */
.ap-tumpuk--kolase {
  align-items: center;
  gap: 20px 12px;
}

.ap-tumpuk--kolase .ap-tumpuk__kartu {
  width: calc((100% - 24px) / 3);
}

.ap-tumpuk--kolase .ap-polaroid__tulis {
  min-height: 2em;
  font-size: 15px;
}

.ap-tumpuk--kolase ~ .ap-tumpuk__nav {
  display: none;
}

.ap-tumpuk__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 26px;
}

.ap-tumpuk__alat {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 14px;
}

/* Pita negatif: satu bingkai per foto, ketuk untuk loncat */
.ap-negatif {
  position: relative;
  display: flex;
  gap: 5px;
  /* saat foto muat, pita duduk di tengah; saat tidak muat, tetap bisa digeser dari kiri */
  justify-content: safe center;
  width: min(92cqw, 560px);
  padding: 15px 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background:
    radial-gradient(circle at 7px 7px, var(--ap-linen) 0 2.4px, transparent 2.8px) 0 0 / 14px 14px repeat-x,
    radial-gradient(circle at 7px 7px, var(--ap-linen) 0 2.4px, transparent 2.8px) 0 100% / 14px 14px repeat-x,
    #2a2420;
  border-radius: 4px;
  box-shadow: var(--ap-bayang);
  scroll-snap-type: x proximity;
}

.ap-negatif::-webkit-scrollbar {
  display: none;
}

.ap-negatif[hidden] {
  display: none;
}

.ap-negatif__bingkai {
  position: relative;
  flex: none;
  width: 44px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  background: #4a423a;
  cursor: pointer;
  opacity: 0.55;
  scroll-snap-align: center;
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.ap-negatif__bingkai img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.35) saturate(0.85);
  pointer-events: none;
}

.ap-negatif__bingkai span {
  position: absolute;
  left: 3px;
  bottom: 2px;
  font: 400 10px/1 var(--ap-ketik);
  color: #f5ead8;
  text-shadow: 0 1px 2px #000;
}

.ap-negatif__bingkai:hover {
  opacity: 0.85;
}

.ap-negatif__bingkai.is-aktif {
  opacity: 1;
  transform: translateY(-3px) scale(1.12);
  outline: 2px solid var(--ap-cap);
  outline-offset: 1px;
  z-index: 1;
}

.ap-negatif__bingkai.is-aktif img {
  filter: none;
}

.ap-negatif__bingkai:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.ap-meja__tgl {
  margin: 0.1em 0 0;
  font-size: clamp(20px, 5.4cqw, 28px);
  line-height: 1.1;
  color: var(--ap-cap);
  text-align: center;
}

.ap-mode {
  padding-left: 16px;
}

.ap-mode::before {
  display: none;
}

.ap-tumpuk__hitung {
  min-width: 80px;
  text-align: center;
  font-size: 30px;
}

.ap-bulat {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--ap-putih);
  box-shadow: var(--ap-bayang);
  font: 400 30px/1 var(--ap-badan);
  color: var(--ap-tinta);
  cursor: pointer;
}

.ap-bulat:hover {
  background: #fff;
}

.ap-rol {
  padding-bottom: 64px;
}

.ap-video {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.ap-video a {
  scroll-margin-bottom: 90px;
}

/* Kisah: foto dijepit di tali */
.ap-tali {
  position: relative;
  display: grid;
  gap: 54px;
}

.ap-tali__item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding-top: 26px;
}

.ap-tali__item::before {
  /* seutas tali melintang */
  content: '';
  position: absolute;
  top: 10px;
  left: -20px;
  right: -20px;
  height: 22px;
  border-bottom: 2px solid #9b8668;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  opacity: 0.8;
}

.ap-tali__foto {
  width: min(66cqw, 280px);
  transform-origin: 50% 0;
}

.ap-jepit {
  position: absolute;
  z-index: 3;
  top: 18px;
  left: 50%;
  width: 14px;
  height: 46px;
  margin-left: -7px;
  border-radius: 3px;
  background: linear-gradient(90deg, #c9a77b, #e1c497 45%, #b8935f);
  box-shadow: 0 2px 3px rgb(60 45 30 / 0.3);
}

.ap-jepit::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 16px;
  height: 6px;
  border-radius: 2px;
  background: #8e8a86;
}

.ap-tali__teks {
  max-width: 420px;
  text-align: center;
}

.ap-tali__teks h3 {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ap-tali__teks p {
  font-size: 16px;
  color: var(--ap-teks);
}

/* Acara */
.ap-jadwal__atas {
  display: grid;
  gap: 40px;
  justify-items: center;
}

.ap-postit {
  width: 200px;
  padding: 22px 18px 18px;
  background: #f6dc7c;
  box-shadow:
    0 1px 1px rgb(60 45 30 / 0.15),
    0 12px 18px -10px rgb(60 45 30 / 0.45);
  transform: rotate(var(--r, 0deg));
  text-align: center;
}

.ap-postit__tgl {
  font-size: 44px;
  font-weight: 700;
}

.ap-hitung {
  margin-top: 8px;
  font-size: 22px;
  color: var(--ap-cap);
}

.ap-acara-daftar {
  display: grid;
  gap: 40px;
  width: 100%;
  justify-items: center;
}

.ap-acara {
  width: min(100%, 440px);
  padding-top: 30px;
}

.ap-acara__nama {
  margin: 4px 0 14px;
  font-size: 44px;
  font-weight: 700;
}

.ap-acara__rinci {
  display: grid;
  gap: 10px;
  font-size: 16px;
  line-height: 1.55;
}

.ap-acara__rinci div {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
}

.ap-acara__rinci dt {
  font-size: 13px;
  color: var(--ap-pudar);
  padding-top: 3px;
  text-transform: uppercase;
}

.ap-acara__aksi {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* Buku tamu */
.ap-buku {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  padding: 58px 24px 30px;
  background: var(--ap-indeks) url(aset/kertas.svg);
  box-shadow: var(--ap-bayang);
  border-radius: 2px 2px 6px 6px;
}

.ap-buku__spiral {
  position: absolute;
  top: -14px;
  left: 18px;
  right: 18px;
  height: 34px;
  background:
    radial-gradient(circle at 50% 70%, var(--ap-linen-gelap) 0 5px, transparent 5.5px) 0 0 / 28px 34px,
    linear-gradient(to right, transparent 9px, #8d8a85 9px 12px, #c9c6c0 12px 14px, transparent 14px) 0 0 /
      28px 24px repeat-x;
}

.ap-buku .ap-judul {
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 2px double rgb(180 68 47 / 0.35);
}

.ap-buku > .ap-kecil {
  text-align: center;
  margin-bottom: 22px;
}

.ub-rsvp__batas {
  font: 400 14px/1.5 var(--ap-ketik);
  color: var(--ap-cap);
  text-align: center;
  margin-bottom: 18px;
}

.ub-rsvp__form {
  display: grid;
  gap: 20px;
}

.ub-rsvp__hadir {
  margin: 0;
  padding: 0;
  border: 0;
}

.ub-rsvp__hadir legend,
.ub-rsvp__jumlah > span,
.ub-rsvp__ucapan > span {
  display: block;
  margin-bottom: 8px;
  font: 700 28px/1 var(--ap-tangan);
  color: var(--ap-tinta);
}

.ub-rsvp__pilihan {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ub-pilihan {
  position: relative;
  cursor: pointer;
}

.ub-pilihan input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.ub-pilihan span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 16px;
  border: 1.5px solid rgb(39 55 94 / 0.35);
  border-radius: 999px;
  font: 400 15px var(--ap-ketik);
  background: rgb(255 255 255 / 0.6);
}

.ub-pilihan input:checked + span {
  border-color: var(--ap-tinta);
  background: var(--ap-tinta);
  color: var(--ap-putih);
}

.ub-pilihan input:focus-visible + span {
  outline: 2px dashed var(--ap-tinta);
  outline-offset: 3px;
}

.ub-rsvp__jumlah select,
.ub-rsvp__ucapan textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1.5px solid rgb(39 55 94 / 0.4);
  background: transparent;
  font: 600 26px/1.25 var(--ap-tangan);
  color: var(--ap-tinta);
  border-radius: 0;
}

.ub-rsvp__ucapan textarea {
  resize: vertical;
  line-height: 32px;
  padding: 0 4px;
  background: repeating-linear-gradient(to bottom, transparent 0 31px, rgb(39 55 94 / 0.25) 31px 32px);
  border-bottom: 0;
}

.ub-rsvp__jumlah select:focus,
.ub-rsvp__ucapan textarea:focus {
  outline: none;
  border-color: var(--ap-tinta);
}

.ub-rsvp__catatan,
.ub-rsvp__status:not(:empty),
.ub-rsvp__nojs {
  font: 400 14px/1.5 var(--ap-ketik);
  color: var(--ap-pudar);
}

.ub-rsvp__status:not(:empty) {
  color: var(--ap-cap);
}

.ub-rsvp--tutup p {
  font: 600 26px/1.3 var(--ap-tangan);
  color: var(--ap-tinta);
  text-align: center;
}

.ub-tombol--tautan {
  background: none;
  text-decoration: underline;
  color: var(--ap-pudar);
}

/* Ucapan: tempelan post-it kecil */
.ap-ucapan {
  max-width: 1000px;
  margin: 54px auto 0;
}

.ub-ucapan__kepala {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 12px;
  margin-bottom: 24px;
}

.ub-ucapan__kepala h3 {
  font: 700 36px/1 var(--ap-tangan);
  color: var(--ap-tinta);
}

.ub-ucapan__jumlah {
  flex-basis: 100%;
  text-align: center;
  font: 400 14px var(--ap-ketik);
  color: var(--ap-pudar);
}

.ub-ucapan__daftar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  max-height: 560px;
  overflow-y: auto;
  padding: 12px 8px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgb(60 45 30 / 0.4) transparent;
}

/* Klien menandai daftar yang masih bisa digulir; ujung bawahnya memudar supaya terbaca "masih ada lagi" */
.ub-ucapan__daftar[data-gulir~='bawah'] {
  mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
}

.ub-ucapan__daftar[data-gulir~='atas'] {
  mask-image: linear-gradient(to bottom, transparent, #000 40px);
}

.ub-ucapan__daftar[data-gulir~='atas'][data-gulir~='bawah'] {
  mask-image: linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 56px), transparent);
}

.wish {
  padding: 16px 16px 14px;
  background: #fbf3c9;
  box-shadow:
    0 1px 1px rgb(60 45 30 / 0.12),
    0 8px 12px -8px rgb(60 45 30 / 0.4);
  transform: rotate(-1.5deg);
}

.wish:nth-child(3n + 2) {
  background: #e4efe2;
  transform: rotate(1.2deg);
}

.wish:nth-child(3n) {
  background: #f6e1db;
  transform: rotate(-0.6deg);
}

.wish__avatar {
  display: none;
}

.wish__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.wish__name {
  font: 700 24px/1 var(--ap-tangan);
  color: var(--ap-tinta);
}

.wish__time {
  font: 400 12px var(--ap-ketik);
  color: var(--ap-pudar);
}

.wish__message {
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Hadiah: amplop kertas cokelat */
.ap-amplop {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 92px 22px 26px;
  background: url(aset/kertas.svg), linear-gradient(160deg, #d2ab7f, var(--ap-kraft));
  box-shadow: var(--ap-bayang);
  border-radius: 4px;
}

.ap-amplop__tutup {
  position: absolute;
  inset: 0 0 auto;
  height: 96px;
  background: linear-gradient(170deg, #b88c5c, #a87c4e);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 2px rgb(60 40 20 / 0.3));
}

.ap-amplop__tutup::after {
  /* segel lilin */
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #c75a47, #92311f 70%);
}

.ub-amplop__pengantar {
  margin-bottom: 18px;
  font-size: 16px;
  color: #3a2a18;
  text-align: center;
}

.ap-amplop__isi {
  display: grid;
  gap: 16px;
}

.ub-amplop__rekening {
  display: grid;
  gap: 2px;
  padding: 16px 18px;
  background: var(--ap-indeks) url(aset/kertas.svg);
  box-shadow: 0 2px 4px rgb(60 40 20 / 0.25);
}

.ub-amplop__rekening:nth-child(odd) {
  transform: rotate(-0.8deg);
}

.ub-amplop__rekening:nth-child(even) {
  transform: rotate(0.9deg);
}

.ub-amplop__bank {
  font: 400 13px var(--ap-ketik);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ap-pudar);
}

.ub-amplop__nomor {
  font: 700 30px/1.1 var(--ap-tangan);
  color: var(--ap-tinta);
  letter-spacing: 0.02em;
}

.ub-amplop__nama {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.ub-amplop__rekening .ub-tombol {
  justify-self: start;
  margin-top: 8px;
  padding: 6px 14px;
  min-height: 40px;
  background: #f1e3c4;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgb(60 45 30 / 0.25);
}

/* Penutup */
.ap-penutup {
  display: grid;
  gap: 34px;
  justify-items: center;
  padding-bottom: 96px;
}

.ap-penutup__foto {
  width: min(78cqw, 380px);
}

.ap-penutup__teks {
  max-width: 460px;
  text-align: center;
}

.ap-penutup__ttd {
  margin-top: 18px;
  font-size: 38px;
  font-weight: 700;
}

.ap-kaki {
  padding: 26px 20px 96px;
  text-align: center;
  font-size: 12px;
  color: var(--ap-pudar);
  display: grid;
  gap: 4px;
}

/* Musik: piringan kecil */
.ap-musik {
  position: fixed;
  z-index: 40;
  right: calc(var(--ub-kolom-kiri) + 14px);
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 16px 6px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--ap-putih);
  box-shadow: var(--ap-bayang);
  cursor: pointer;
  font-size: 22px;
}

.ap-musik__piringan {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--ap-cap) 0 5px, #1d1a17 5.5px 7px, transparent 7.5px),
    repeating-radial-gradient(circle, #2a2622 0 1.5px, #3a3530 1.5px 3px);
}

.ap-musik[aria-pressed='false'] .ap-musik__piringan {
  animation: ap-putar 2.4s linear infinite;
}

@keyframes ap-putar {
  to {
    transform: rotate(1turn);
  }
}

/* ---------- Layar lebar ---------- */


.ap-penutup.ap-penutup--teks {
  grid-template-columns: minmax(0, 520px);
}

.ap-penutup--teks .ap-penutup__teks {
  text-align: center;
}

/*
 * Gerak (CSS saja, ringan). Tiap gerak hanya memakai properti yang tidak bentrok dengan transform kartu
 * (`rotate`, `scale`, `translate` terpisah dari `transform`). Yang memakai scroll-driven (view()) hanya
 * aktif di browser yang mendukungnya; di tempat lain tampilannya tetap, dan informasi tetap terbaca.
 */

/* 1. Judul bagian: coretan tinta ditarik saat judul masuk layar */
@supports (animation-timeline: view()) {
  .ap-bagian > .ap-judul {
    position: relative;
  }

  .ap-bagian > .ap-judul::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -14px;
    height: 3px;
    border-radius: 2px;
    background: var(--ap-tinta);
    opacity: 0.8;
    transform-origin: 0 50%;
    animation: ap-coret linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 35%;
  }
}

@keyframes ap-coret {
  from {
    scale: 0 1;
  }
  to {
    scale: 1 1;
  }
}

/* 2. Stempel di sampul: dicap sekali saat halaman dibuka, sedikit lewat ukuran lalu mendarat */
.ap-cap {
  animation: ap-cap 0.5s cubic-bezier(0.3, 1.35, 0.5, 1) 0.45s both;
}

@keyframes ap-cap {
  from {
    opacity: 0;
    scale: 1.6;
  }
  to {
    opacity: 0.94;
    scale: 1;
  }
}

/* 3. Kisah: foto yang dijepit di tali berayun pelan dari titik jepit (ujung atas) */
.ap-tali__foto {
  animation: ap-ayun 4.6s ease-in-out infinite alternate;
}

.ap-tali__item:nth-child(even) .ap-tali__foto {
  animation-duration: 5.4s;
  animation-delay: -2.2s;
}

@keyframes ap-ayun {
  from {
    rotate: -1.2deg;
  }
  to {
    rotate: 1.2deg;
  }
}

/* 4. Amplop: tutup kertasnya terangkat pelan saat amplop masuk layar */
@supports (animation-timeline: view()) {
  .ap-amplop {
    perspective: 700px;
  }

  .ap-amplop__tutup {
    transform-origin: 50% 0;
    animation: ap-tutup linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }
}

@keyframes ap-tutup {
  from {
    transform: rotateX(0deg);
  }
  to {
    transform: rotateX(-100deg);
  }
}

/* 5. Ucapan: tiap tempelan masuk dari bawah saat digulir ke layarnya */
@supports (animation-timeline: view()) {
  .wish {
    animation: ap-masuk linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}

@keyframes ap-masuk {
  from {
    opacity: 0;
    translate: 0 24px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* 6. Tombol: naik sedikit saat disorot, turun saat ditekan, seperti tombol karet di atas meja */
.ap-tombol,
.ap-label-tag {
  transition:
    translate 0.15s ease,
    box-shadow 0.15s ease;
}

.ap-tombol:hover {
  translate: 0 -2px;
  box-shadow: 0 5px 0 rgb(20 30 55 / 0.35);
}

.ap-tombol:active {
  translate: 0 2px;
  box-shadow: 0 1px 0 rgb(20 30 55 / 0.35);
}

.ap-label-tag:hover {
  translate: 0 -2px;
}

.ap-label-tag:active {
  translate: 0 1px;
}
