/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent scrolling during intro */
    background-color: #333;
    /* Dark background for desktop wrapper */
    font-family: 'Cardo', serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    position: relative;
    width: 100%;
    max-width: 428px;
    /* Standard Pro Max width */
    height: 100%;
    height: 100dvh;
    background-color: #E9E3DA;
    /* Adjusted to flawlessly match the inner welcome screen */
    overflow: hidden;
    box-shadow: 0px 4px 60px rgba(0, 0, 0, 0.6);
}

/* Main Content Container (Hidden initially under the curtain) */
.main-invitation {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background-color: #E9E3DA;
    z-index: 1;
    overflow: hidden;
}

/* Glitter / Sparkle effects */
.glitter-container {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
    transition: opacity 2s ease 1s;
    /* Fades out slightly when welcome text appears */
}

.main-invitation.ready .glitter-container {
    opacity: 0.15;
    /* Subtle shimmering background */
}

.sparkle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.9), 0 0 12px 3px rgba(215, 188, 120, 0.6);
    opacity: 0;
    animation: twinkle ease-in-out infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Invitation content scroll wrapper */
.invitation-content {
    scroll-behavior: smooth;
}

/* Intro Screen Wrapper */
.intro-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 10;
}

/* Curtains */
.curtain {
    position: absolute;
    width: 100%;
    height: 50%;
    left: 0;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: transform;
}

.curtain-top {
    top: 0;
    background: linear-gradient(180deg, #FEF3FF 0%, #FEF3FF 100%);
    z-index: 2;
    /* Essential for Center Lock overlaying bottom half */
}

.curtain-bottom {
    top: 50%;
    background: linear-gradient(180deg, #FEF3FF 0%, #FEF3FF 100%);
    z-index: 1;
}

/* Background Patterns container (assuming full-cover png elements) */
.bg-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    background-size: cover;
    background-position: center top;
    opacity: 0.7;
    /* Optional text legibility */
}

.top-pattern {
    top: 0;
    background-image: url('../bg/Bg-top.png');
}

.bottom-pattern {
    bottom: 0;
    background-position: center bottom;
    background-image: url('../bg/bg-bottom.png');
}

/* Typography styles based exactly on Figma details */
.invite-text {
    position: absolute;
    bottom: 96px;
    /* Offset from center */
    width: 100%;
    font-family: 'Cardo', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 28px;
    line-height: 38px;
    text-align: center;
    color: #3E2840;
    z-index: 2;
}

.click-text {
    position: absolute;
    top: 87px;
    /* Offset from center */
    width: 100%;
    font-family: 'Cardo', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 18px;
    line-height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #3E2840;
    z-index: 2;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 5px rgba(215, 188, 120, 0.4);
    }
}

/* Center Lock Group */
.center-lock {
    position: absolute;
    width: 100%;
    height: 134px;
    /* The height of the seal */
    bottom: -67px;
    /* Centered visually right on the split edge of top curtain */
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15;
    cursor: pointer;
}

/* Gold Ribbon Halves */
.gold-ribbon-half {
    position: absolute;
    width: 100%;
    height: 11px;
    /* Half of 22px */
    left: 0;
    background-image: linear-gradient(0deg, #937015 0%, #D7BC78 51.44%, #C39826 100%);
    background-size: 100% 22px;
    z-index: 5;
}

.gold-ribbon-half.top {
    bottom: 0;
    background-position: top;
}

.gold-ribbon-half.bottom {
    top: 0;
    background-position: bottom;
    box-shadow: 0px 4px 4px rgba(112, 100, 84, 0.28);
}

/* Round Seal */
.seal {
    position: relative;
    width: 134px;
    height: 134px;
    background: #FFEBFF;
    box-shadow: 0px 4.5px 4px rgba(74, 70, 64, 0.42);
    border-radius: 100px;
    /* Fully rounded */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: transform 0.3s ease;
}

.center-lock:hover .seal {
    transform: scale(1.03);
    /* Subtle pop on hover */
}

/* Centered Initials - Italianno font */
.initials {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Italianno', cursive;
    color: #834988;
    font-size: 60px;
}

/* Positional coordinates for F and H inside the circle based on relative Figma specs */
.f {
    position: absolute;
    left: 33px;
    top: 14px;
    font-size: 60px;
    line-height: 75px;
    /* identical to box height */
}

.h {
    position: absolute;
    left: 54px;
    top: 46px;
    font-size: 60px;
    line-height: 75px;
    /* identical to box height */
}

/* Animation Sub-state open */
.intro-screen.open .curtain-top {
    transform: translateY(calc(-100% - 120px));
    /* Moves high enough to clear the full shadow and seal perfectly */
    pointer-events: none;
}

.intro-screen.open .curtain-bottom {
    transform: translateY(100%);
    pointer-events: none;
}

/* Lenis Smooth Scroll */
html.lenis, html.lenis body {
  height: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body {
  width: 100%;
  overflow-x: clip;
  position: relative;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}