/* ============================================================
   SPLASH — вибір між Дитячими святами та Весіллям
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: Inter, "Playpen Sans", system-ui, -apple-system, sans-serif;
    overflow: hidden;
    background: #0a0810;
}

@media (max-width: 767px) {
    html, body { overflow: auto; height: auto; }
}

/* ──────────────────────────────────────────
   TOP LOGO BAR
────────────────────────────────────────── */
.sp-logo-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 24px;
    pointer-events: none;
}

.sp-logo {
    height: 38px;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,.55)) brightness(0) invert(1);
    opacity: 0;
    transform: translateY(-14px);
    transition: opacity .55s ease .6s, transform .55s ease .6s;
    pointer-events: all;
    text-decoration: none;
    display: block;
}

.is-ready .sp-logo { opacity: 1; transform: none; }

/* ──────────────────────────────────────────
   WRAPPER
────────────────────────────────────────── */
.splash {
    display: flex;
    width: 100%;
    height: 100dvh;
    position: relative;
}

@media (max-width: 767px) {
    .splash {
        flex-direction: column;
        height: auto;
        min-height: 100svh;
    }
}

/* ──────────────────────────────────────────
   VERTICAL DIVIDER
────────────────────────────────────────── */
.sp-divider {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(255,255,255,.6) 18%,
        rgba(255,255,255,.9) 50%,
        rgba(255,255,255,.6) 82%,
        transparent 100%
    );
    z-index: 20;
    pointer-events: none;
    transform: scaleY(0);
    transition: transform .65s cubic-bezier(.4,0,.2,1) .9s;
}
.is-ready .sp-divider { transform: scaleY(1); }

@media (max-width: 767px) { .sp-divider { display: none; } }

/* ──────────────────────────────────────────
   PANEL
────────────────────────────────────────── */
.sp-panel {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: flex .55s cubic-bezier(.4,0,.2,1);
}

@media (min-width: 768px) {
    .sp-panel:hover { flex: 1.42; }
}

@media (max-width: 767px) {
    .sp-panel {
        flex: none;
        min-height: 50svh;
        min-height: 50dvh;
    }

    .sp-bg {
        transform: none;
    }

    .sp-panel--kids .sp-bg {
        background-position: center 42%;
    }

    .sp-panel--wedding .sp-bg {
        background-position: center 28%;
    }
}

/* ──────────────────────────────────────────
   BACKGROUND LAYERS
────────────────────────────────────────── */
.sp-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.06);
    transition: transform .65s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}
.sp-panel:hover .sp-bg { transform: scale(1); }

.sp-panel--kids .sp-bg {
    background-image: url('/assets/background desktop.jpg');
    background-color: #e87070;
}

.sp-panel--wedding .sp-bg {
    background-image: url('/assets/wedding/hero-main.png');
    background-color: #2a1040;
    background-position: center 30%;
}

/* Color overlays */
.sp-overlay {
    position: absolute;
    inset: 0;
    transition: opacity .45s;
}

.sp-panel--kids .sp-overlay {
    background: linear-gradient(150deg,
        rgba(231,38,129,.55) 0%,
        rgba(247,147,30,.42) 50%,
        rgba(53,179,74,.32)  100%
    );
}

.sp-panel--wedding .sp-overlay {
    background: linear-gradient(150deg,
        rgba(10,5,20,.78) 0%,
        rgba(30,12,50,.62) 50%,
        rgba(10,5,20,.72) 100%
    );
}

/* Darken sibling on hover */
@media (min-width: 768px) {
    .splash:has(.sp-panel--kids:hover) .sp-panel--wedding .sp-overlay { opacity: 1.6; }
    .splash:has(.sp-panel--wedding:hover) .sp-panel--kids .sp-overlay { opacity: 1.6; }
}

/* ──────────────────────────────────────────
   PARTICLES
────────────────────────────────────────── */
.sp-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Kids sparkles */
.sp-panel--kids .sp-particle {
    position: absolute;
    width: var(--sz, 6px);
    height: var(--sz, 6px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.95) 0%, transparent 70%);
    left: var(--x, 50%);
    top: var(--y, 50%);
    animation: sparkleFloat var(--dur, 3s) ease-in-out infinite var(--dl, 0s);
    opacity: 0;
}

@keyframes sparkleFloat {
    0%   { opacity: 0; transform: translateY(0) scale(.7); }
    30%  { opacity: .9; }
    70%  { opacity: .6; }
    100% { opacity: 0; transform: translateY(-50px) scale(1.15); }
}

/* Wedding petals */
.sp-panel--wedding .sp-particle {
    position: absolute;
    width: var(--sz, 10px);
    height: var(--sz, 10px);
    border-radius: 50% 0 50% 0;
    background: rgba(201, 64, 106, .55);
    left: var(--x, 50%);
    top: -10%;
    animation: petalFall var(--dur, 7s) linear infinite var(--dl, 0s);
    opacity: 0;
}

@keyframes petalFall {
    0%   { opacity: 0; transform: rotate(0deg) translateX(0); }
    8%   { opacity: .75; }
    88%  { opacity: .5; }
    100% { opacity: 0; transform: rotate(270deg) translateX(30px) translateY(110vh); }
}

/* ──────────────────────────────────────────
   CONTENT
────────────────────────────────────────── */
.sp-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 36px 32px;
    max-width: 480px;
    color: #fff;
}

.sp-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 6px 18px;
    border-radius: 999px;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .5s ease, transform .5s ease;
}
.sp-panel--kids    .sp-tag { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.5); color: #fff; }
.sp-panel--wedding .sp-tag { background: rgba(201,168,110,.2); border: 1px solid rgba(201,168,110,.55); color: #C9A96E; }

.sp-title {
    font-size: clamp(40px, 5.5vw, 80px);
    font-weight: 900;
    line-height: 1.03;
    color: #fff;
    margin: 0 0 14px;
    font-family: "Playpen Sans", cursive;
    text-shadow: 0 4px 28px rgba(0,0,0,.35);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease .1s, transform .6s ease .1s;
}

.sp-desc {
    font-size: clamp(14px, 1.7vw, 16px);
    line-height: 1.62;
    color: rgba(255,255,255,.82);
    margin: 0 0 32px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .6s ease .2s, transform .6s ease .2s;
    max-width: 300px;
    margin-inline: auto;
    margin-bottom: 32px;
}

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 36px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity   .6s ease .3s,
        transform .6s ease .3s,
        background .25s,
        box-shadow .25s,
        border-color .25s;
}

.sp-panel--kids .sp-btn {
    color: #fff;
    border: 2px solid rgba(255,255,255,.75);
    background: rgba(255,255,255,.15);
}
.sp-panel--wedding .sp-btn {
    color: #C9A96E;
    border: 2px solid rgba(201,168,110,.65);
    background: rgba(201,168,110,.1);
}

.sp-btn:hover {
    background: rgba(255,255,255,.28) !important;
    border-color: rgba(255,255,255,.95) !important;
    color: #fff !important;
    box-shadow: 0 12px 32px rgba(0,0,0,.28) !important;
    transform: translateY(-3px) !important;
}

/* Loaded = visible */
.is-ready .sp-tag,
.is-ready .sp-title,
.is-ready .sp-desc,
.is-ready .sp-btn  { opacity: 1; transform: translateY(0); }

/* ──────────────────────────────────────────
   SCROLL HINT (mobile)
────────────────────────────────────────── */
.sp-scroll-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,.5);
    font-size: 11px;
    z-index: 10;
    opacity: 0;
    transition: opacity .5s ease .8s;
}
.sp-scroll-hint::after {
    content: '';
    width: 1px;
    height: 36px;
    background: linear-gradient(180deg, rgba(255,255,255,.4), transparent);
    animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{opacity:.4;transform:scaleY(1)} 50%{opacity:1;transform:scaleY(1.3)} }

@media (max-width: 767px) {
    .sp-scroll-hint { display: flex; }
    .is-ready .sp-scroll-hint { opacity: 1; }
}

/* ──────────────────────────────────────────
   INITIAL PANEL ENTRANCE (slide in)
────────────────────────────────────────── */
.sp-panel--kids    { opacity: 0; transform: translateX(-28px); }
.sp-panel--wedding { opacity: 0; transform: translateX(28px);  }

.sp-panel--kids {
    transition:
        flex .55s cubic-bezier(.4,0,.2,1),
        opacity .65s ease .2s,
        transform .65s cubic-bezier(.22,.8,.24,1) .2s;
}
.sp-panel--wedding {
    transition:
        flex .55s cubic-bezier(.4,0,.2,1),
        opacity .65s ease .32s,
        transform .65s cubic-bezier(.22,.8,.24,1) .32s;
}

.is-ready .sp-panel--kids,
.is-ready .sp-panel--wedding { opacity: 1; transform: none; }

/* Override hover transition after ready */
.is-ready .sp-panel--kids {
    transition: flex .55s cubic-bezier(.4,0,.2,1);
}
.is-ready .sp-panel--wedding {
    transition: flex .55s cubic-bezier(.4,0,.2,1);
}

/* ──────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────── */
@media (max-width: 767px) {
    .sp-bg {
        transform: none !important;
    }

    .sp-logo-bar {
        padding: max(12px, env(safe-area-inset-top)) 18px 10px;
    }

    .sp-logo {
        height: clamp(26px, 7.5vw, 32px);
    }

    .sp-content {
        width: 100%;
        max-width: 380px;
        padding: 58px 20px 38px;
    }

    .sp-tag {
        font-size: 10px;
        letter-spacing: .14em;
        padding: 5px 14px;
        margin-bottom: 12px;
    }

    .sp-title {
        font-size: clamp(34px, 10vw, 50px);
        line-height: 1;
        margin-bottom: 10px;
    }

    .sp-desc {
        font-size: 13px;
        line-height: 1.45;
        max-width: 280px;
        margin-bottom: 20px;
    }

    .sp-btn {
        width: min(100%, 260px);
        min-height: 46px;
        padding: 11px 20px;
        font-size: 14px;
        line-height: 1.2;
        text-align: center;
    }
}

@media (max-width: 380px), (max-height: 720px) {
    .sp-content {
        padding: 46px 14px 28px;
    }

    .sp-title {
        font-size: clamp(30px, 9vw, 40px);
    }

    .sp-desc {
        font-size: 12px;
        line-height: 1.35;
        margin-bottom: 14px;
    }

    .sp-btn {
        min-height: 42px;
        padding: 9px 16px;
        font-size: 13px;
    }

    .sp-scroll-hint {
        display: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sp-particle { animation: none !important; }
    .sp-panel--kids,
    .sp-panel--wedding,
    .sp-bg,
    .sp-logo,
    .sp-divider { transition: none !important; opacity: 1 !important; transform: none !important; }
    .is-ready .sp-tag, .is-ready .sp-title, .is-ready .sp-desc, .is-ready .sp-btn {
        transition: none !important;
    }
}
