@tailwind base;
@tailwind components;
@tailwind utilities;

/*
   Palet "merah & putih, sedang jatuh cinta":
   - merah anggur dalam (red-950 #450a0a, red-900 #7f1d1d) untuk section gelap
   - putih & blush lembut (white, rose-50 #fff1f2) untuk section terang
   - aksen rose (rose-300/400/500/600) untuk label, border, tombol
   - #2b0709 (arbitrary, lebih gelap dari red-950) untuk footer/preloader/overlay
   Semua dipakai lewat class Tailwind bawaan (red-*, rose-*, white) atau
   nilai arbitrary bg-[#...] — tidak perlu ubah tailwind.config.js.
*/

@layer base {
    html {
        scroll-behavior: smooth;
    }

    html:not(.is-open) body {
        height: 100vh;
        overflow: hidden;
    }
}

@layer utilities {
    .perspective-800 { perspective: 800px; }
    .perspective-1200 { perspective: 1200px; }
    .perspective-1600 { perspective: 1600px; }

    .preserve-3d { transform-style: preserve-3d; }

    .backface-hidden { backface-visibility: hidden; }

    .animate-spin-slow {
        animation: spin 3.5s linear infinite;
    }

    /* Kaca buram hangat — dipakai pada kartu yang ingin terasa "mengambang"
       di atas latar tanpa menutupinya sepenuhnya. */
    .glass-dark {
        background: rgba(69, 10, 10, 0.55);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(251, 113, 133, 0.16);
    }
    .glass-light {
        background: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(244, 63, 94, 0.18);
    }

    .text-glow {
        text-shadow: 0 0 26px rgba(255, 205, 210, 0.5);
    }
}

/* ---------- Reveal per-section (state awal sebelum GSAP menganimasikannya) ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px) rotateX(6deg) translateZ(-40px);
    transform-style: preserve-3d;
}

/* Dihormati untuk pengguna yang meminta gerakan lebih sedikit */
@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
    #cover, #cover-panel {
        transition: none !important;
    }
    #preloader-bar {
        transition: none !important;
    }
    .aurora-bg {
        animation: none !important;
    }
    #countdown-timer [data-countdown="seconds"] {
        animation: none !important;
    }
}

/* ---------- Kartu hitung mundur — kedalaman 3D statis + kaca hangat ---------- */
.countdown-card {
    background: rgba(69, 10, 10, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.55);
    transform: rotateY(0deg) translateZ(0);
    transition: transform .4s ease, box-shadow .4s ease;
}
.countdown-card:hover {
    transform: rotateY(6deg) translateZ(10px);
    box-shadow: 0 18px 36px -14px rgba(244, 63, 94, 0.4);
}

/* Detak halus di angka detik — seperti debar jantung, bukan animasi di semua angka */
#countdown-timer [data-countdown="seconds"] {
    display: inline-block;
    animation: heartbeat 1s ease-in-out infinite;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ---------- Kartu detail acara — sedikit terangkat saat dihover ---------- */
.event-card {
    transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease;
    box-shadow: 0 14px 30px -18px rgba(69, 10, 10, 0.3);
}
.event-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 26px 44px -20px rgba(69, 10, 10, 0.35);
}

/* ---------- Mini-game: kartu memori dengan flip 3D ---------- */
.memory-card {
    position: relative;
    aspect-ratio: 3 / 4;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.memory-card.is-flipped,
.memory-card.is-matched {
    transform: rotateY(180deg);
}
.memory-card__face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.memory-card__back {
    background: linear-gradient(135deg, #7f1d1d, #450a0a);
    border: 1px solid rgba(251, 113, 133, 0.35);
}
.memory-card__back svg { color: rgba(253, 164, 175, 0.65); }
.memory-card__front {
    transform: rotateY(180deg);
    border: 1px solid rgba(251, 113, 133, 0.5);
}
.memory-card__front img {
    width: 100%; height: 100%; object-fit: cover;
}
.memory-card.is-matched .memory-card__front {
    box-shadow: 0 0 0 2px #fb7185 inset;
}

/* ---------- Guestbook: kartu ucapan baru muncul dengan sedikit depth ---------- */
.wish-item {
    transform-style: preserve-3d;
}
.wish-item.is-new {
    animation: wishIn .6s cubic-bezier(.2,.8,.2,1);
}
@keyframes wishIn {
    from { opacity: 0; transform: translateY(16px) rotateX(-8deg); }
    to   { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* ---------- Foto mempelai — cincin lembut saat disorot (lihat resources/js/tilt.js) ---------- */
[data-tilt] {
    transform-style: preserve-3d;
    will-change: transform;
    transition: box-shadow .45s ease;
}
[data-tilt]:hover {
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.4), 0 20px 40px -18px rgba(69, 10, 10, 0.5);
}

/* ---------- Partikel ambient di seluruh halaman (lihat resources/js/particles.js) ---------- */
#ambient-particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 40;
}

#cover-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---------- Glow "aurora" animatif di belakang section tertentu ---------- */
.aurora-bg {
    position: absolute;
    inset: -25%;
    z-index: 0;
    pointer-events: none;
    filter: blur(70px);
    opacity: 0.6;
    background:
        radial-gradient(circle at 20% 30%, rgba(244, 63, 94, 0.4), transparent 55%),
        radial-gradient(circle at 80% 25%, rgba(255, 255, 255, 0.14), transparent 50%),
        radial-gradient(circle at 50% 85%, rgba(190, 18, 60, 0.35), transparent 55%);
    animation: auroraDrift 20s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(2%, -3%, 0) scale(1.08); }
    100% { transform: translate3d(-3%, 2%, 0) scale(1.03); }
}

/* ---------- Preloader "Made by RAFNST TECH" ---------- */
#preloader {
    z-index: 100;
}
#preloader-bar {
    transition: width .25s ease-out;
}

/* ---------- Indikator scroll berbentuk hati ---------- */
#scroll-heart-fill {
    transition: stroke-dashoffset .1s linear;
}

/* ---------- Ledakan hati (heart-burst) — feedback setelah RSVP/ucapan terkirim ---------- */
.heart-burst-particle {
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 200;
    will-change: transform, opacity;
    animation: heartBurstFloat 1.1s ease-out forwards;
    margin-left: -8px;
    margin-top: -8px;
}
@keyframes heartBurstFloat {
    0%   { transform: translate(0, 0) scale(0.3) rotate(0deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* ---------- Timeline "Kisah Kami" ---------- */
#story-line-fill {
    width: 100%;
    transform-origin: top;
}
