/* ======================================================================
   1. TOKENS
   ====================================================================== */
:root {
  --ig-grad: linear-gradient(45deg, #feda75, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5);
  --like: #ff3040;
  --text: #fff;
  --muted: rgba(255, 255, 255, .72);
  --glass: rgba(20, 20, 20, .42);
  --glass-line: rgba(255, 255, 255, .16);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Playfair Display', Georgia, serif;
  --reel-h: 100vh;
  --phone-w: 100vw;
}
@supports (height: 100svh) { :root { --reel-h: 100svh; } }

html, body { height: 100%; margin: 0; overflow: hidden; background: #000; }
body { font-family: var(--font-body); color: var(--text); -webkit-font-smoothing: antialiased; }

/* Desktop: feed tampil sebagai layar ponsel 9:16 di tengah, latar foto diburamkan */
.backdrop { position: fixed; inset: -40px; z-index: 0; background: #000 center / cover no-repeat; filter: blur(40px) brightness(.45) saturate(1.2); transition: background-image .6s; }
.phone { position: relative; z-index: 1; height: var(--reel-h); width: var(--phone-w); margin: 0 auto; overflow: hidden; background: #000; }
@media (min-width: 600px) {
  :root { --phone-w: min(100vw, calc(var(--reel-h) * 9 / 16)); }
  .phone { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 80px rgba(0, 0, 0, .6); }
}

/* ======================================================================
   2. VERTICAL FULL-SCREEN SNAP ENGINE
   ====================================================================== */
.reels {
  height: 100vh;
  height: var(--reel-h);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.reels::-webkit-scrollbar { display: none; }
.reel {
  position: relative;
  height: 100vh;
  height: var(--reel-h);
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;          /* 1 swipe = 1 reel */
  isolation: isolate;
}

/* Media latar penuh + gradien gelap di bawah */
.reel-media { position: absolute; inset: 0; z-index: -2; background: #111; }
.reel-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); }
.reel.is-active .reel-media img { animation: kenburns 14s ease-out forwards; }   /* gerak pelan seperti video */
@keyframes kenburns { to { transform: scale(1.14) translateY(-2%); } }
.reel-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .45) 0%, transparent 18%, transparent 45%, rgba(0, 0, 0, .55) 70%, rgba(0, 0, 0, .9) 100%); }
/* Reel padat informasi: lapisan gelap lebih tebal agar teks tetap kontras di foto terang */
.reel-shade.strong { background: linear-gradient(180deg, rgba(0, 0, 0, .65), rgba(0, 0, 0, .45) 40%, rgba(0, 0, 0, .9)); }

/* Area konten utama tiap reel (di atas info bawah & kiri dari sidebar) */
.reel-content {
  position: absolute; left: 0; right: 64px; top: 56px; bottom: 150px;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 .9rem 0 1rem; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
}
.reel-content::-webkit-scrollbar { display: none; }
.reel-content > * { flex-shrink: 0; }

/* ======================================================================
   3. OVERLAY UI ALA REELS
   ====================================================================== */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: max(.8rem, env(safe-area-inset-top)) 1rem .5rem; pointer-events: none; }
.topbar h1 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.topbar .counter { font-size: .78rem; font-weight: 600; padding: .25rem .6rem; border-radius: 50rem; background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); }

.reel-actions { position: absolute; right: .55rem; bottom: 6.8rem; z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 1.05rem; }
.act { display: flex; flex-direction: column; align-items: center; gap: .15rem; border: 0; padding: 0; background: none; color: #fff; font-size: .72rem; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.act i { font-size: 1.75rem; line-height: 1; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); transition: transform .2s; }
.act:active i { transform: scale(.85); }
.act:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 8px; }
.act-like[aria-pressed="true"] i { color: var(--like); animation: pop .45s cubic-bezier(.17, .89, .32, 1.49); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.cnt.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: translateY(-4px); } }

/* Piringan vinyl (pemutar musik) */
.vinyl {
  width: 2.6rem; height: 2.6rem; padding: 6px; border: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle, #111 0 2px, #2a2a2a 2px 3px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 4px 10px rgba(0, 0, 0, .5);
}
.vinyl img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
body.is-playing .vinyl { animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.vinyl:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.muted-badge { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; display: none; place-items: center; border-radius: 50%; background: #fff; color: #000; font-size: .62rem; }
body:not(.is-playing) .muted-badge { display: grid; }

.reel-info { position: absolute; left: 0; right: 64px; bottom: 0; z-index: 10; padding: 0 .9rem calc(1rem + env(safe-area-inset-bottom)) 1rem; }
.user { display: flex; align-items: center; gap: .55rem; margin-bottom: .45rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; padding: 2px; background: var(--ig-grad); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #000; }
.user strong { font-size: .88rem; font-weight: 600; }
.user .bi-patch-check-fill { color: #3897f0; font-size: .8rem; }
.follow { border: 1px solid rgba(255, 255, 255, .7); background: transparent; color: #fff; font-size: .72rem; font-weight: 600; padding: .2rem .65rem; border-radius: 8px; }
.follow[aria-pressed="true"] { border-color: transparent; background: rgba(255, 255, 255, .2); }
.caption { margin: 0 0 .5rem; font-size: .84rem; line-height: 1.4; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.caption .tags { color: #e0f0ff; font-weight: 600; }
.audio-line { display: flex; align-items: center; gap: .45rem; font-size: .78rem; max-width: 230px; }
.marquee { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee span { display: inline-block; padding-right: 2rem; animation: marquee 10s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* Ledakan hati saat ketuk dua kali */
.heart-burst { position: absolute; z-index: 30; pointer-events: none; font-size: 6rem; color: #fff; filter: drop-shadow(0 4px 20px rgba(255, 48, 64, .7)); transform: translate(-50%, -50%) scale(0); animation: burst .9s ease forwards; }
.heart-burst i { background: linear-gradient(135deg, #ff6b6b, #ff3040 60%, #c2185b); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes burst { 15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(.95); } 70% { transform: translate(-50%, -60%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -120%) scale(.8); opacity: 0; } }

/* ======================================================================
   4. KONTEN TIAP REEL
   ====================================================================== */
.glass { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.kicker { font-size: .7rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.big-names { font-family: var(--font-head); font-style: italic; font-weight: 500; font-size: clamp(2.8rem, 13vw, 3.8rem); line-height: 1.02; margin: .4rem 0; text-shadow: 0 4px 24px rgba(0, 0, 0, .5); }
.h-reel { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.7rem, 7.5vw, 2.1rem); line-height: 1.15; margin: 0 0 .4rem; text-shadow: 0 2px 14px rgba(0, 0, 0, .5); }
.date-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border-radius: 50rem; font-size: .82rem; font-weight: 600; background: rgba(255, 255, 255, .16); border: 1px solid var(--glass-line); backdrop-filter: blur(8px); }
.swipe-up { display: inline-flex; flex-direction: column; align-items: center; gap: .1rem; margin-top: 1.4rem; font-size: .72rem; font-weight: 600; color: var(--muted); }
.swipe-up i { font-size: 1.2rem; animation: up 1.6s ease-in-out infinite; }
@keyframes up { 50% { transform: translateY(-6px); } }

.arabic { font-family: 'Amiri', serif; font-size: clamp(1.15rem, 5vw, 1.45rem); line-height: 2; direction: rtl; margin: 0 0 .5rem; }
.verse { font-family: var(--font-head); font-style: italic; font-size: .95rem; line-height: 1.6; margin: 0; }

/* Story mempelai */
.story-bars { position: absolute; top: calc(max(.8rem, env(safe-area-inset-top)) + 2.4rem); left: .8rem; right: .8rem; z-index: 15; display: flex; gap: 4px; }
.story-bars span { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.story-bars span i { display: block; height: 100%; width: 0; background: #fff; }
.story-media img { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.story-media img.on { opacity: 1; }
.story-tap { position: absolute; top: 0; bottom: 0; z-index: 5; width: 35%; border: 0; background: transparent; }
.story-tap.prev { left: 0; } .story-tap.next { right: 64px; width: 30%; }
.story-card { display: none; }
.story-card.on { display: block; }
.story-card .who { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.story-card .ring { width: 48px; height: 48px; border-radius: 50%; padding: 2px; background: var(--ig-grad); }
.story-card .ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #000; }

/* Acara */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .6rem 0; }
.cd { padding: .5rem .2rem; text-align: center; border-radius: 12px; }
.cd b { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd small { font-size: .58rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.event { padding: .7rem .8rem; margin-bottom: .5rem; }
.event h3 { font-size: .98rem; font-weight: 700; margin: 0 0 .15rem; }
.event p { margin: 0 0 .35rem; font-size: .76rem; color: var(--muted); line-height: 1.45; }
.pill-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .8rem; border-radius: 50rem; border: 0; font-size: .74rem; font-weight: 600; text-decoration: none; color: #000; background: #fff; }
.pill-btn:hover { color: #000; background: #e9e9e9; }
.pill-btn.ghost { color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid var(--glass-line); }
.pill-btn.grad { color: #fff; background: var(--ig-grad); }

/* Galeri carousel */
.carousel-x { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 16px; }
.carousel-x::-webkit-scrollbar { display: none; }
.carousel-x figure { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; }
.carousel-x img { width: 100%; height: 100%; object-fit: cover; }
.dots { display: flex; justify-content: center; gap: 5px; margin-top: .55rem; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .4); transition: .3s; }
.dots i.on { background: #3897f0; transform: scale(1.2); }

/* Amplop */
.bank { position: relative; overflow: hidden; padding: .95rem 1rem; margin-bottom: .6rem; border-radius: 16px; }
.bank::after { content: ""; position: absolute; inset: -60%; background: linear-gradient(115deg, transparent 44%, rgba(255, 255, 255, .18) 50%, transparent 56%); animation: shine 5s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 55% { transform: translateX(-50%); } 100% { transform: translateX(50%); } }
.bank-bca { background: linear-gradient(135deg, #1e3a8a, #0f172a); }
.bank-mandiri { background: linear-gradient(135deg, #92400e, #1c1917); }
.bank .name { font-weight: 800; font-style: italic; font-size: 1.05rem; }
.bank .no { font-size: 1.25rem; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums; margin: .25rem 0; }
.bank .holder { font-size: .72rem; color: var(--muted); }

/* Komentar ala Instagram */
.comments { max-height: calc(var(--reel-h) - 330px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: .7rem .8rem .2rem; }
.comments::-webkit-scrollbar { display: none; }
.cmt { display: flex; gap: .6rem; margin-bottom: .85rem; }
.cmt.is-new { animation: cmtIn .6s ease; }
@keyframes cmtIn { from { opacity: 0; transform: translateY(-8px); } }
.cmt .av { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--ig-grad); }
.cmt .body { flex: 1; min-width: 0; font-size: .8rem; line-height: 1.4; }
.cmt .body b { margin-right: .3rem; }
.cmt .meta { display: flex; gap: .7rem; margin-top: .15rem; font-size: .68rem; color: var(--muted); }
.cmt .att { color: #8fd19e; }
.cmt .att.no { color: #ff8a8a; } .cmt .att.maybe { color: #ffd479; }
.cmt .heart { border: 0; background: none; color: var(--muted); padding: 0 .2rem; font-size: .78rem; align-self: center; }
.cmt .heart[aria-pressed="true"] { color: var(--like); }
.fake-input { display: flex; align-items: center; gap: .6rem; width: 100%; margin-top: .5rem; padding: .55rem .8rem; border-radius: 50rem; border: 1px solid var(--glass-line); background: rgba(0, 0, 0, .35); color: var(--muted); font-size: .82rem; text-align: left; }
.fake-input img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

/* ======================================================================
   5. BOTTOM SHEET (RSVP & GIFT), COVER, TOAST
   ====================================================================== */
.sheet-backdrop { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .3s; }
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 86%; overflow-y: auto;
  padding: .5rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0;
  background: #1c1c1e; color: #fff; transform: translateY(105%); transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}
.sheet.is-open { transform: none; }
.sheet .handle { width: 40px; height: 4px; margin: .3rem auto .8rem; border-radius: 4px; background: rgba(255, 255, 255, .3); }
.sheet h2 { font-size: 1rem; font-weight: 700; text-align: center; margin: 0 0 1rem; }
.sheet .form-label { font-size: .72rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; }
.sheet .form-control, .sheet .form-select { background-color: #2c2c2e; border: 1px solid #3a3a3c; color: #fff; border-radius: 12px; font-size: .9rem; }
.sheet .form-control::placeholder { color: #8e8e93; }
.sheet .form-control:focus, .sheet .form-select:focus { background-color: #2c2c2e; color: #fff; border-color: #3897f0; box-shadow: 0 0 0 .2rem rgba(56, 151, 240, .25); }
.sheet .form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E"); }
.attend { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.attend input { position: absolute; opacity: 0; pointer-events: none; }
.attend label { padding: .55rem .2rem; text-align: center; font-size: .8rem; font-weight: 600; border-radius: 12px; border: 1px solid #3a3a3c; background: #2c2c2e; cursor: pointer; }
.attend input:checked + label { border-color: #3897f0; background: rgba(56, 151, 240, .2); }
.attend input:focus-visible + label { outline: 2px solid #3897f0; }
.btn-ig { width: 100%; border: 0; border-radius: 12px; padding: .7rem; font-weight: 700; font-size: .9rem; color: #fff; background: #0095f6; }
.btn-ig:hover { background: #1877f2; }

.cover {
  position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1.5rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .85)), var(--cover-img, none) center / cover;   /* --cover-img diisi dari $data['cover_photo'] di blade */
  transition: opacity .6s, visibility .6s, transform .6s;
}
.cover.is-hidden { opacity: 0; visibility: hidden; transform: scale(1.05); }
.cover .ring { width: 104px; height: 104px; border-radius: 50%; padding: 4px; background: var(--ig-grad); animation: ring-rotate 4s linear infinite; }
.cover .ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #000; animation: ring-rotate 4s linear infinite reverse; }
@keyframes ring-rotate { to { transform: rotate(360deg); } }
.cover .guest { margin: 1.1rem 0 1.4rem; padding: .7rem 1.2rem; border-radius: 14px; background: rgba(255, 255, 255, .12); border: 1px solid var(--glass-line); backdrop-filter: blur(8px); }
.cover .guest small { display: block; font-size: .74rem; color: var(--muted); }
.cover .guest strong { font-size: 1.05rem; word-break: break-word; }
.watch-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.6rem; border: 0; border-radius: 50rem; font-weight: 700; font-size: .95rem; color: #fff; background: var(--ig-grad); box-shadow: 0 10px 30px -8px rgba(214, 41, 118, .7); }
.watch-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.toast-x { position: absolute; left: 50%; bottom: 7rem; z-index: 70; padding: .6rem 1rem; border-radius: 12px; font-size: .84rem; font-weight: 500; background: rgba(38, 38, 38, .95); color: #fff; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .3s; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.toast-x.is-show { opacity: 1; transform: translate(-50%, 0); }

/* Navigasi desktop (di luar layar ponsel) */
.desk-nav { position: fixed; right: calc(50% - var(--phone-w) / 2 - 4.5rem); top: 50%; z-index: 2; display: none; flex-direction: column; gap: .6rem; transform: translateY(-50%); }
.desk-nav button { width: 3rem; height: 3rem; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.2rem; }
.desk-nav button:hover { background: rgba(255, 255, 255, .25); }
@media (min-width: 900px) { .desk-nav { display: flex; } }

@media (max-height: 680px) {
  .reel-content { top: 48px; bottom: 132px; }
  .reel-actions { gap: .8rem; bottom: 6rem; }
  .act i { font-size: 1.5rem; }
  .big-names { font-size: 2.6rem; }
  .carousel-x figure { aspect-ratio: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .reel.is-active .reel-media img, .marquee span, body.is-playing .vinyl, .cover .ring, .cover .ring img { animation: none; }
  .reels { scroll-behavior: auto; }
}

/* ======================================================================
   6. UTILITAS (dipindah dari atribut style inline)
   ====================================================================== */
.note { font-size: .84rem; color: var(--muted); }
.muted { color: var(--muted); }
.reel-content.content-end { justify-content: flex-end; }
.reel-media img.gallery-bg { filter: blur(18px) brightness(.6); transform: scale(1.2); }
.reel-media img.dim { filter: brightness(.6); }
.address-note { font-size: .74rem; }
.cmt-title { font-size: .92rem; }
.families { font-size: .8rem; line-height: 1.7; }
.credit { font-size: .66rem; color: var(--muted); }
.cover-handle { font-weight: 700; }
.verified { color: #3897f0; }
.big-names.cover-title { font-size: 2.6rem; }
