:root {
    --primary-color: #B5956A;
    --primary-dark: #8c714e;
    --text-dark: #5C544F;
    --text-light: #7a7069;
    --bg-color: #FDFBF8;
}

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

body {
    background-color: var(--bg-color);
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: 'Cormorant Garamond', serif;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.invitation-container {
    width: 100%;
    max-width: 550px;
    background: rgba(253, 251, 248, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 200px 200px 8px 8px; /* Arch shape */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    position: relative;
    padding: 10px;
}

.card-border {
    border: 2px solid var(--primary-color);
    border-radius: 200px 200px 8px 8px; /* Arch shape */
    padding: 4rem 2rem 3rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cross {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.subtitle {
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-light);
    margin: 1rem 0;
}

.title, .name {
    font-family: 'Alex Brush', cursive;
    background: linear-gradient(
        to right,
        var(--primary-dark) 20%,
        #d8b88d 40%,
        #f5ecd8 50%,
        #d8b88d 60%,
        var(--primary-dark) 80%
    );
    background-size: 200% auto;
    color: #000;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
    filter: drop-shadow(1px 1px 2px rgba(255, 255, 255, 0.6));
    font-weight: 400;
}

.title {
    font-size: 4.5rem;
    margin: 0;
    line-height: 1.1;
}

.name {
    font-size: 5rem;
    margin: 0.5rem 0 2rem;
    line-height: 1;
}

.details {
    margin: 1rem 0 2rem;
}

.date {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.location, .time, .lunch {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.location a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(122, 112, 105, 0.5);
    transition: all 0.3s ease;
    padding-bottom: 2px;
}

@media (hover: hover) {
    .location a:hover {
        color: var(--primary-dark);
        border-bottom: 1px solid var(--primary-dark);
    }
}

.calendar-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cal-btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

@media (hover: hover) {
    .cal-btn:hover {
        background: var(--primary-color);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(181, 149, 106, 0.3);
    }
}

.countdown-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(181, 149, 106, 0.4);
    width: 100%;
}

.countdown-title {
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    perspective: 1000px;
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    min-width: 70px;
    border-radius: 12px;
    box-shadow: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, background 0.4s ease;
    transform-style: preserve-3d;
}

@media (hover: hover) {
    .time-box:hover {
        transform: translateY(-5px) scale(1.05) rotateX(10deg);
        box-shadow: 0 12px 25px rgba(181, 149, 106, 0.25), inset 0 2px 10px rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.4);
    }
}

.time-box span:first-child {
    font-size: 2.2rem;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    color: var(--primary-dark);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.time-box .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    font-weight: 500;
}


@media (max-width: 600px) {
    body {
        padding: 0.5rem;
    }
    
    .card-border {
        padding: 2.5rem 0.5rem 1.5rem;
        border-width: 1.5px;
    }
    
    .title { font-size: clamp(3rem, 12vw, 4.5rem); }
    .name { font-size: clamp(3.5rem, 15vw, 5rem); }
    
    .countdown {
        gap: 0.8rem;
        flex-wrap: nowrap;
    }
    
    .time-box {
        min-width: auto;
        padding: 0;
    }
    
    .time-box span:first-child {
        font-size: 1.8rem;
    }
    
    .time-box .label {
        font-size: 0.65rem;
    }

    .calendar-links {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
    }

    .cal-btn {
        width: 90%;
        text-align: center;
        padding: 0.8rem 1.2rem;
    }

    .envelope {
        transform: scale(0.85);
    }

    .envelope.open-anim {
        transform: scale(0.85) translateY(100px);
    }
}

/* Entrance Animations */
@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in-up {
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 1.2s ease-out forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 0.9s; }
.delay-4 { animation-delay: 1.2s; }
.delay-5 { animation-delay: 1.5s; }
.delay-6 { animation-delay: 1.8s; }

/* Interactive Envelope Screen */
.envelope-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-color);
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out, visibility 1s;
}

.envelope-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.envelope {
    position: relative;
    width: 320px;
    height: 220px;
    background: #e5d7c9;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    transition: transform 0.6s ease;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 115px solid #dbc8b6;
    transform-origin: top;
    transition: transform 0.6s 0.3s ease-in-out;
    z-index: 3;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}

.envelope-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-bottom: 110px solid #dcd1c7;
    z-index: 2;
}

.envelope-left {
    position: absolute;
    top: 0;
    left: 0;
    border-top: 110px solid transparent;
    border-bottom: 110px solid transparent;
    border-left: 160px solid #e5d7c9;
    z-index: 2;
}

.envelope-right {
    position: absolute;
    top: 0;
    right: 0;
    border-top: 110px solid transparent;
    border-bottom: 110px solid transparent;
    border-right: 160px solid #e5d7c9;
    z-index: 2;
}

.wax-seal {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75px;
    height: 75px;
    background: radial-gradient(circle at 30% 30%, #C5A880, #917551);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.75rem;
    font-family: 'Cormorant Garamond', serif;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 2px 4px rgba(255,255,255,0.3);
    cursor: pointer;
    z-index: 4;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid rgba(255,255,255,0.1);
    animation: stampSeal 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stampSeal {
    0% {
        transform: translate(-50%, -300%) scale(0.2);
        opacity: 0;
        color: transparent;
    }
    30% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 1;
        color: transparent;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        color: transparent;
    }
    70% {
        transform: translate(-50%, -50%) scale(1);
        color: transparent;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        color: white;
    }
}

@media (hover: hover) {
    .wax-seal:hover {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 6px 15px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.4);
    }
}

/* Open Animations */
.envelope.open-anim .wax-seal {
    opacity: 0;
    pointer-events: none;
}

.envelope.open-anim .envelope-flap {
    transform: rotateX(180deg);
}

.envelope.open-anim {
    transform: translateY(100px);
    opacity: 0;
    transition: transform 1s 0.8s ease, opacity 1s 0.8s ease;
}
