/* ====================================================
   INVITO BABY SHOWER — STYLE SHEET (MOCKUP REPLICA)
   ==================================================== */

:root {
    --bg-dark:       #29342c;
    --sage:          #7d9685;
    --sage-light:    #a3b8aa;
    
    --card-bg:       #faf6f0; /* Soft warm ivory cotton paper */
    --gold:          #d5b86a; /* Gold foil color */
    --gold-dark:     #9f823a;
    
    --pink:          #d57c91; /* Soft rose pink */
    --blue:          #708fa8; /* Dusty blue */
    
    --ink:           #2c3539;
    --ink-light:     #555f65;

    --font-script:   'Great Vibes', cursive;
    --font-display:  'Playfair Display', serif;
    --font-body:     'Cormorant Garamond', serif;
    --font-text:     'Montserrat', sans-serif;
}

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

body {
    background: var(--bg-dark);
    color: var(--ink);
    font-family: var(--font-body);
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* ====================================================
   PHASES
   ==================================================== */
.phase {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .8s ease;
}
.phase.active { opacity: 1; pointer-events: auto; }

/* ====================================================
   PHASE 1: COVER VIDEO (GIFT BOX)
   ==================================================== */
#cover-phase {
    background: #0f1411;
    flex-direction: column;
}
#cover-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0f1411;
}
.bow-tap-area {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}
.bow-pulse {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(213,184,106,.4);
    animation: bowPulse 2s ease-in-out infinite;
}
.bow-pulse.delay { animation-delay: 1s; }
@keyframes bowPulse {
    0%   { transform: scale(.8); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}
.cover-cta {
    position: absolute;
    bottom: 12%;
    left: 0; right: 0;
    text-align: center;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.cta-icon { font-size: 1.4rem; animation: ctaFloat 2s ease-in-out infinite; }
@keyframes ctaFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.cta-text {
    font-family: var(--font-text);
    font-size: .8rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0,0,0,.8);
    background: rgba(41,52,44,.6);
    padding: 6px 18px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* ====================================================
   PHASE 2: INVITATION CARD
   ==================================================== */
#invite-phase {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

/* Dreamy background */
.dreamy-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(213,184,106,.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(112,143,168,.08) 0%, transparent 40%),
        linear-gradient(135deg, #1b261f 0%, #0c120e 100%);
    z-index: 0;
}

#cloud-sparkle-canvas {
    position: fixed;
    inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

.invite-scroll {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 24px 14px 40px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}
#invite-phase.active .invite-scroll {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================================
   THE CARD (Mockup Replica)
   ==================================================== */
.card {
    position: relative;
    width: 100%;
    background-color: var(--card-bg);
    border-radius: 6px;
    box-shadow:
        0 8px 16px rgba(0,0,0,.15),
        0 20px 45px rgba(0,0,0,.25),
        inset 0 0 60px rgba(213,184,106,.05);
    overflow: hidden;
}

/* Cotton paper overlay */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.75' numOctaves='3' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
    opacity: .5;
    pointer-events: none;
    z-index: 0;
}

/* Gold Frame Borders */
.card-border {
    position: absolute;
    inset: 10px;
    border: 1px solid var(--gold);
    pointer-events: none;
    z-index: 10;
}
.card-inner-border {
    position: absolute;
    inset: 14px;
    border: 1px solid var(--gold);
    opacity: 0.6;
    pointer-events: none;
    z-index: 10;
}

/* Gold Corner Swirls */
.corner-flourish {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--gold);
    z-index: 11;
}
.corner-flourish.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.corner-flourish.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.corner-flourish.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.corner-flourish.br { bottom: -1px; right: -1px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

/* ====================================================
   TOP IMAGE HEADER
   ==================================================== */
.card-header-img-container {
    position: relative;
    width: calc(100% - 36px);
    margin: 18px auto 8px;
    height: 190px;
    overflow: hidden;
    z-index: 5;
    border: 1px solid var(--gold);
    border-radius: 4px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
}
.card-header-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
}

/* ====================================================
   CARD CONTENT
   ==================================================== */
.card-content {
    position: relative;
    z-index: 5;
    padding: 20px 22px 28px;
    text-align: center;
}

/* Dividers */
.gold-scroll-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 8px 0;
    opacity: 0.9;
}
.gold-scroll-divider.floral {
    margin: 12px 0 16px;
}

/* Title: BABY SHOWER */
.main-title {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 600;
    letter-spacing: 5px;
    line-height: 1.1;
    margin: 4px 0;
    
    /* Gold foil effect */
    background: linear-gradient(135deg, var(--gold-dark) 0%, #f7e3a6 40%, var(--gold) 60%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 1px rgba(255,255,255,0.4);
}

/* Calligraphy: Per il piccolo Edoardo */
.baby-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 0;
}
.baby-name {
    font-family: var(--font-script);
    font-size: 2.3rem;
    color: var(--pink);
    font-weight: 400;
    line-height: 1.1;
}
.heart-symbol {
    font-size: 0.75rem;
    vertical-align: middle;
}
.heart-symbol.pink { color: var(--pink); }
.heart-symbol.blue { color: var(--blue); }

/* Parents: Mamma Beatrice e Papà Francesco */
.parents-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--blue);
    font-weight: 400;
    margin: 4px 0 6px;
}

/* Event Details List */
.details-list {
    max-width: 330px;
    margin: 0 auto 20px;
    text-align: left;
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 6px;
    border-bottom: 1px dotted #e2dcd3;
}
.detail-item:last-child {
    border-bottom: none;
}
.detail-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.detail-icon.pink-icon { color: #e5a9b4; }
.detail-icon.green-icon { color: #8fa697; }

.detail-text {
    font-family: var(--font-body);
    font-size: 0.98rem;
    color: var(--ink);
    font-weight: 500;
    line-height: 1.3;
}

/* Registry Button: Apri Lista Nascita */
.registry-block {
    margin: 18px 0 12px;
}
.btn-nascita {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fef5f6 0%, #fcdfe2 100%);
    border: 1.5px solid var(--gold);
    border-radius: 100px;
    padding: 5px 22px 5px 6px;
    text-decoration: none;
    max-width: 290px;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(213,184,106,0.12);
    transition: all 0.3s ease;
}
.btn-icon-circle {
    width: 34px;
    height: 34px;
    background: #faf6f0;
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.btn-gift-icon {
    color: var(--pink);
    font-size: 20px !important;
}
.btn-text {
    font-family: var(--font-text);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pink);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    flex-grow: 1;
    text-align: center;
}
.btn-nascita:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(213,184,106,0.25);
    background: linear-gradient(135deg, #fff9fa 0%, #fbd5d9 100%);
}
.btn-nascita:hover .btn-icon-circle {
    transform: scale(1.05);
}

/* RSVP Confirm button (secondary elegant button to confirm presence) */
.rsvp-confirm-block {
    margin: 14px 0 16px;
}
.btn-rsvp-confirm {
    display: inline-block;
    font-family: var(--font-text);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 100px;
    padding: 8px 22px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: rgba(112,143,168,0.04);
}
.btn-rsvp-confirm:hover {
    background: var(--blue);
    color: #fff;
    transform: translateY(-1px);
}

/* Footer bow container */
.footer-bow-container {
    margin-top: 14px;
    opacity: 0.85;
}

.bottom-flourish {
    text-align: center;
    margin-top: 16px;
    font-size: .8rem;
    color: var(--sage-light);
    letter-spacing: 8px;
    opacity: .5;
}

/* ====================================================
   ANIMATIONS & EFFECTS
   ==================================================== */
.bow-tap-area.breaking {
    animation: bowBreak .6s ease forwards;
}
@keyframes bowBreak {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    30%  { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.flash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(253,239,191,.4);
    z-index: 100;
    animation: flashFade .8s ease forwards;
}
@keyframes flashFade {
    0% { opacity: 1; } 100% { opacity: 0; }
}

/* Staggered entrance */
.card-content > * {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity .5s ease, transform .5s ease;
}
#invite-phase.active .card-content > * {
    opacity: 1;
    transform: translateY(0);
}
#invite-phase.active .card-content > *:nth-child(1)  { transition-delay: .2s; }
#invite-phase.active .card-content > *:nth-child(2)  { transition-delay: .4s; }
#invite-phase.active .card-content > *:nth-child(3)  { transition-delay: .6s; }
#invite-phase.active .card-content > *:nth-child(4)  { transition-delay: .8s; }
#invite-phase.active .card-content > *:nth-child(5)  { transition-delay: .9s; }
#invite-phase.active .card-content > *:nth-child(6)  { transition-delay: 1.0s; }
#invite-phase.active .card-content > *:nth-child(7)  { transition-delay: 1.1s; }
#invite-phase.active .card-content > *:nth-child(8)  { transition-delay: 1.2s; }
#invite-phase.active .card-content > *:nth-child(9)  { transition-delay: 1.3s; }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-height: 800px) {
    .card-header-img-container { height: 160px; }
    .main-title { font-size: 1.9rem; }
    .baby-name { font-size: 2.1rem; }
    .detail-item { padding: 10px 6px; }
}

@media (max-height: 720px) {
    .card-header-img-container { height: 130px; }
    .main-title { font-size: 1.7rem; }
    .baby-name { font-size: 1.9rem; }
    .detail-item { padding: 8px 6px; }
    .btn-nascita { padding: 4px 18px 4px 4px; }
}
