:root {
    --bg-red: #ff1a1a;
    --pink-wavy: #ff66cc;
    --cream-text: #fff5cc;
    --dark-text: #0a0a3a;
    --rsvp-orange: #ff6600;
    --font-headers: 'Nerko One', cursive;
    --font-body: 'Caveat Brush', cursive;
    --font-details: 'Caveat Brush', cursive;
    
    /* Desktop font sizes */
    --font-size-h1: 9rem;
    --font-size-large: 3rem;
    --font-size-medium: 2.0rem;
    --font-size-small: 1.8rem;
    --font-size-very-small: 1.2rem;
}

@media (max-width: 768px) {
    :root {
        --font-size-h1: 4.5rem;
        --font-size-large: 2.5rem;
        --font-size-medium: 1.6rem;
        --font-size-small: 1.4rem;
        --font-size-very-small: 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-h1: 3.5rem;
        --font-size-large: 2.2rem;
        --font-size-medium: 1.4rem;
        --font-size-small: 1.2rem;
        --font-size-very-small: 0.9rem;
    }
}

html {
    scroll-snap-type: y mandatory;
    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar {
    display: none;
}

html.no-scroll {
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f4e8d1; /* Paper-like background for the page */
    color: var(--cream-text);
    font-family: var(--font-body), cursive;
    overflow-x: hidden;
    height: 300vh; /* Create even more scrollable area for multiple cards */
}

body.intro .invitation-container {
    animation: poster-in 2000ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.intro .invitation-container::before {
    animation: wave-slide-left 2000ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.intro .invitation-container::after {
    animation: wave-slide-right 2000ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.intro .top-wave {
    animation: wave-drop 2000ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.intro .bottom-wave {
    animation: wave-rise 2000ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.intro h1 span,
body.intro h1 .and {
    opacity: 0;
    transform: translateY(20px) rotate(-2deg) scale(0.98);
    animation: text-pop 4000ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

body.intro h1 span:nth-child(1) {
    animation-delay: 300ms;
}

body.intro h1 .and {
    animation-delay: 450ms;
}

body.intro h1 span:nth-child(3) {
    animation-delay: 600ms;
}

body.intro .details p {
    opacity: 0;
    transform: translateY(16px);
    animation: detail-in 2000ms ease-out both;
}

body.intro .details p:nth-child(1) {
    animation-delay: 700ms;
}

body.intro .details p:nth-child(2) {
    animation-delay: 800ms;
}

body.intro .details p:nth-child(3) {
    animation-delay: 900ms;
}

body.intro .details p:nth-child(4) {
    animation-delay: 1000ms;
}

body.intro .details p:nth-child(5) {
    animation-delay: 1100ms;
}

body.intro .details p:nth-child(6) {
    animation-delay: 1200ms;
}

.snap-section {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    /* pointer-events: none; - Removed to allow triggers to work better if needed, though they were absolute */
}

/* Main Container */
.invitation-container {
    position: fixed; /* Keep it in place */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-red);
    padding: 80px;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* RSVP Card Styling */
.rsvp-card {
    position: fixed;
    bottom: -50%; /* Initially hidden below screen */
    left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.98);
    opacity: 0;
    width: 50%;
    height: 55%;
    background-color: var(--rsvp-orange);
    border-radius: 50% 50% 0% 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
    transition: bottom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease;
    z-index: 100;
    cursor: pointer;

    @media (max-width: 768px) {
        width: 100%;
    }
}

.rsvp-card.visible {
    bottom: 0;
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
    animation: card-rise 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rsvp-card .rsvp-header {
    font-family: var(--font-headers), cursive;
    font-size: var(--font-size-large);
    margin: 0 0 2rem 0;
}

.rsvp-text {
    text-align: center;
    font-family: var(--font-body), cursive;
    font-size: var(--font-size-medium);
    margin: 0;
}

.date-card-time, .date-card-location{
    font-family: var(--font-headers), cursive;
    font-size: var(--font-size-small);
}

.rsvp-card .rsvp-phone {
    font-family: var(--font-details), cursive;
    font-size: var(--font-size-small);
    margin: 2rem 0 0 0;
}

/*here*/
/* Additional Info Card Styling (Cloud shape) */
.additional-info-card {
    position: fixed;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-2deg); /* Start from center and scaled down */
    width: 70%;
    height: 60%;
    background-color: var(--cream-text);
    /* Cloud edge using clip-path */
    clip-path: url(#cloud-clip);
    -webkit-clip-path: url(#cloud-clip);
    /* Add a filter to simulate the shadow which is lost with clip-path */
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--dark-text); /* Black text for better contrast on cream */
    text-decoration: none;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    opacity: 0;
    z-index: 110; /* Higher than RSVP card */
    cursor: pointer;

    @media (max-width: 768px) {
        width: 90%;
        height: 50%;
    }
}

.additional-info-card.visible {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
    animation: cloud-pop 700ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.additional-info-card .additional-info-header {
    font-family: var(--font-headers), cursive;
    font-size: var(--font-size-large);
    margin: 0;
    text-align: center;
}

.additional-info-card .additional-info-text {
    font-family: var(--font-body), cursive;
    font-size: var(--font-size-medium);
    margin: 0;
    text-align: center;
}

/**/
.scroll-trigger-1 {
    pointer-events: none;
}

.scroll-trigger-2 {
    pointer-events: none;
}

#inviteeName {
    font-size: var(--font-size-large);
    margin-bottom: 2rem;
}

/* Wavy borders */
.invitation-container::before,
.invitation-container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px; /* Increased width */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 40'%3E%3Cpath d='M0 0 Q 10 10 0 20 Q 10 30 0 40 L 20 40 L 20 0 Z' fill='%23ff66cc'/%3E%3C/svg%3E");
    background-repeat: repeat-y;
    background-size: 100% 120px; /* Larger wave pattern */
}

.invitation-container::before {
    left: 0;
}

.invitation-container::after {
    right: 0;
    transform: scaleX(-1);
}

.top-wave, .bottom-wave {
    position: absolute;
    left: 0;
    right: 0;
    height: 60px; /* Increased height for better visibility on full screen */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cpath d='M0 0 Q 10 10 20 0 Q 30 10 40 0 L 40 20 L 0 20 Z' fill='%23ff66cc'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 120px 100%; /* Larger wave pattern */
    z-index: 1;
}

.top-wave {
    top: 0;
    transform: scaleY(-1);
}

.bottom-wave {
    bottom: 0;
}

/* Typography */
.content {
    position: relative;
    z-index: 2;
}

h1 {
    font-family: var(--font-headers), cursive;
    color: var(--cream-text);
    font-size: var(--font-size-h1);
    margin: 0 0 1rem 0;
    line-height: 1;
    text-transform: uppercase;
    transform: rotate(-2deg);
    word-spacing: 15px;
}

h1 span {
    display: block;
    margin-bottom: 10px;
}

h1 .and {
    font-size: var(--font-size-medium);
    margin: 5px 0;
}

.details {
    font-family: var(--font-details), cursive;
    font-weight: bold;
    color: var(--cream-text);
    margin-top: 50px; /* Increased margin */
    font-size: var(--font-size-medium);
    line-height: 1.4;
}

.details p {
    margin: 10px 0;
    /*text-transform: uppercase;*/
}

/* Responsive Design */
@media (max-width: 768px) {
    .invitation-container {
        /* Keep any other specific 768px styles if needed */
    }
}

@media (max-width: 480px) {
    .invitation-container {
        padding: 40px;
    }

    .invitation-container::before,
    .invitation-container::after {
        width: 40px;
        background-size: 100% 80px;
    }

    .top-wave,
    .bottom-wave {
        height: 40px;
        background-size: 80px 100%;
    }
}

/* Scroll Indicator Styling */
.scroll-indicator {
    position: fixed; /* Changed to fixed to stay on top of the fixed container and cards */
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200; /* Higher than both cards (100 and 110) */
    transition: opacity 0.5s ease, visibility 0.5s ease;
    cursor: pointer;
}

.scroll-indicator.hidden {
    opacity: 0;
    visibility: hidden;
}

.arrow {
    width: 30px;
    height: 30px;
    border-right: 4px solid var(--cream-text);
    border-bottom: 4px solid var(--cream-text);
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(45deg);
    }
    40% {
        transform: translateY(-10px) rotate(45deg);
    }
    60% {
        transform: translateY(-5px) rotate(45deg);
    }
}

@media (max-width: 480px) {
    .scroll-indicator {
        bottom: 50px;
    }

    .arrow {
        width: 20px;
        height: 20px;
        border-right-width: 3px;
        border-bottom-width: 3px;
    }
}

@keyframes poster-in {
    0% {
        transform: scale(0.98);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes wave-slide-left {
    0% {
        transform: translateX(-30px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes wave-slide-right {
    0% {
        transform: translateX(30px) scaleX(-1);
        opacity: 0;
    }
    100% {
        transform: translateX(0) scaleX(-1);
        opacity: 1;
    }
}

@keyframes wave-drop {
    0% {
        transform: translateY(-30px) scaleY(-1);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scaleY(-1);
        opacity: 1;
    }
}

@keyframes wave-rise {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes text-pop {
    0% {
        opacity: 0;
        transform: translateY(20px) rotate(-2deg) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(-2deg) scale(1);
    }
}

@keyframes detail-in {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes card-rise {
    0% {
        transform: translateX(-50%) translateY(24px) scale(0.98);
        opacity: 0;
    }
    60% {
        transform: translateX(-50%) translateY(-6px) scale(1.02);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes cloud-pop {
    0% {
        transform: translate(-50%, -50%) scale(0.85) rotate(-2deg);
        opacity: 0;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.05) rotate(1deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.intro .invitation-container,
    body.intro .invitation-container::before,
    body.intro .invitation-container::after,
    body.intro .top-wave,
    body.intro .bottom-wave,
    body.intro h1 span,
    body.intro h1 .and {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    body.intro .details p {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .rsvp-card,
    .additional-info-card {
        animation: none !important;
    }
    .rsvp-card.visible,
    .additional-info-card.visible {
        opacity: 1 !important;
    }
    .rsvp-card.visible {
        bottom: 0 !important;
        transform: translateX(-50%) translateY(0) scale(1) !important;
    }
    .additional-info-card.visible {
        transform: translate(-50%, -50%) scale(1) rotate(0deg) !important;
    }
}