/* ═══════════════════════════════════════════════════
   ST OSCAR – CURTAIN INTRO STYLESHEET
   v1.0.0
═══════════════════════════════════════════════════ */

#stoscar-curtain {
    --stoscar-gold:    #c9a84c;
    --stoscar-gold-lt: #e8cc84;
    --stoscar-gold-dk: #7a5f1a;
    --stoscar-velvet:  #100c06;

    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    pointer-events: all;
    overflow: hidden;
    will-change: transform;
}

/* ── Pannelli tenda ────────────────────────────── */
#stoscar-curtain .c-left,
#stoscar-curtain .c-right {
    width: 50%;
    height: 100%;
    background: var(--stoscar-velvet);
    position: relative;
    overflow: hidden;
    transition: transform 1.6s cubic-bezier(0.77, 0, 0.18, 1);
    will-change: transform;
}

#stoscar-curtain .c-left  { transform-origin: left center; }
#stoscar-curtain .c-right { transform-origin: right center; }

/* ── Texture velluto verticale ─────────────────── */
#stoscar-curtain .c-left::before,
#stoscar-curtain .c-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 22px,
        rgba(0, 0, 0, 0.22) 22px,
        rgba(0, 0, 0, 0.22) 24px,
        rgba(255, 255, 255, 0.015) 24px,
        rgba(255, 255, 255, 0.015) 26px,
        transparent 26px,
        transparent 52px,
        rgba(0, 0, 0, 0.12) 52px,
        rgba(0, 0, 0, 0.12) 54px
    );
    z-index: 1;
    pointer-events: none;
}

/* ── Vignettature laterali ─────────────────────── */
#stoscar-curtain .c-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, transparent 80%);
    z-index: 2;
    pointer-events: none;
}

#stoscar-curtain .c-right::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(-90deg, rgba(0, 0, 0, 0.6) 0%, transparent 80%);
    z-index: 2;
    pointer-events: none;
}

/* ── Bordi dorati centrali ─────────────────────── */
#stoscar-curtain .gold-edge-l,
#stoscar-curtain .gold-edge-r {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(
        180deg,
        var(--stoscar-gold-dk) 0%,
        var(--stoscar-gold) 15%,
        var(--stoscar-gold-dk) 30%,
        var(--stoscar-gold) 45%,
        var(--stoscar-gold-dk) 60%,
        var(--stoscar-gold) 75%,
        var(--stoscar-gold-dk) 90%,
        var(--stoscar-gold) 100%
    );
    box-shadow:
        0 0 12px rgba(201, 168, 76, 0.5),
        0 0 24px rgba(201, 168, 76, 0.2);
    z-index: 10;
}

#stoscar-curtain .gold-edge-l { right: 0; }
#stoscar-curtain .gold-edge-r { left: 0; }

/* ── Logo centrale ─────────────────────────────── */
#stoscar-curtain .curtain-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9100;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 20px;
}

#stoscar-curtain .curtain-logo img {
    width: clamp(180px, 22vw, 340px);
    height: auto;
    max-height: 60vh;
    filter: drop-shadow(0 4px 32px rgba(201, 168, 76, 0.4));
    animation: stoscar-float 3s ease-in-out infinite;
}

#stoscar-curtain .curtain-logo .logo-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(11px, 1.4vw, 15px);
    font-weight: 500;
    letter-spacing: 0.5em;
    color: var(--stoscar-gold);
    text-transform: uppercase;
    margin: 16px 0 0 0;
    padding-left: 0.5em; /* compensa il letter-spacing */
}

#stoscar-curtain .curtain-logo .logo-sub {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: clamp(13px, 1.8vw, 22px);
    color: rgba(240, 232, 208, 0.7);
    letter-spacing: 0.15em;
    margin: 5px 0 0 0;
}

/* ── Barra avanzamento ─────────────────────────── */
#stoscar-curtain .progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--stoscar-gold-dk),
        var(--stoscar-gold-lt),
        var(--stoscar-gold-dk)
    );
    z-index: 20;
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.6);
}

/* ── Scintille decorative ──────────────────────── */
#stoscar-curtain .stoscar-sparkle {
    position: absolute;
    z-index: 15;
    width: 4px;
    height: 4px;
    background: var(--stoscar-gold-lt);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 6px var(--stoscar-gold-lt);
    animation: stoscar-sparkle 2s ease-in-out infinite;
}

/* ── Stato aperto ──────────────────────────────── */
#stoscar-curtain.open .c-left  { transform: translateX(-100%); }
#stoscar-curtain.open .c-right { transform: translateX(100%); }
#stoscar-curtain.open .curtain-logo { opacity: 0; }

/* ── Animazioni ────────────────────────────────── */
@keyframes stoscar-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@keyframes stoscar-sparkle {
    0%, 100% { opacity: 0; transform: scale(0.3); }
    50%      { opacity: 1; transform: scale(1.2); }
}

/* ── Riduzione movimento (accessibility) ───────── */
@media (prefers-reduced-motion: reduce) {
    #stoscar-curtain .c-left,
    #stoscar-curtain .c-right {
        transition-duration: 0.6s;
    }
    #stoscar-curtain .curtain-logo img,
    #stoscar-curtain .stoscar-sparkle {
        animation: none;
    }
}

/* ── Blocco scroll body durante l'intro ────────── */
body.stoscar-intro-active {
    overflow: hidden;
}
