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

html {
    scroll-behavior: auto;
}

body {
    font-family: 'Georgia', serif;
    color: #333;
}

/* Welcome Section */
.welcome-section {
    min-height: 100vh;
    background: #792c32;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.welcome-content {
    max-width: 650px;
    padding: 50px 30px;
    border: 1px solid #c8ad78;
    outline: 1px solid rgba(200, 173, 120, 0.5);
    outline-offset: 8px;
    animation: fadeIn 1.5s ease;
}

.eyebrow {
    color: #d4bb88;
    font-size: 0.75rem;
    letter-spacing: 5px;
    margin-bottom: 30px;
}

h1 {
    font-size: clamp(3.5rem, 9vw, 6rem);
    font-weight: normal;
    margin-bottom: 20px;
    color: #faf6ed;
}

.welcome-content h2 {
    font-size: 1.6rem;
    font-weight: normal;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #d4bb88;
    margin: 25px 0;
}

.welcome-content > p:not(.eyebrow) {
    color: #f0e3d7;
    font-size: 1rem;
    line-height: 1.9;
    max-width: 400px;
    margin: 0 auto;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #d4bb88;
    margin: 20px auto;
}

.divider::before,
.divider::after {
    content: "";
    width: 65px;
    height: 1px;
    background: #d4bb88;
}

/* Scroll Links */
.scroll-button,
.section-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    margin-top: 45px;
    color: #d4bb88;
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 3px;
    transition: 0.3s ease;
}

.section-button {
    border: solid, 1px;
    padding: 10px;
    background-color: white;
    color: black;
}

.scroll-button span {
    font-size: 1.8rem;
    animation: bounce 1.5s infinite;
}


.section-button:hover {
    background-color: #d4bb88;
}

/* Family Section */
.family-section {
    min-height: 100vh;
    background: #f8f4ec;
    color: #792c32;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
}

.family-content {
    max-width: 850px;
    width: 100%;
}

.family-content .eyebrow,
.secret-content .eyebrow {
    color: #a17d46;
}

.family-content h2,
.secret-content > h2 {
    font-size: 2.5rem;
    font-weight: normal;
    margin-bottom: 20px;
}

.family-content p {
    color: #77716a;
    line-height: 1.8;
    margin-bottom: 35px;
}

.family-content img {
    display: block;
    width: 100%;
    max-height: 550px;
    object-fit: cover;
    border: 6px solid white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.family-content h3 {
    font-size: 1.5rem;
    font-weight: normal;
    margin-top: 35px;
}

/* Secret Santa Section */
.secret-section {
    min-height: 100vh;
    background: #792c32;
    color: #faf6ed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
}

.secret-content {
    max-width: 650px;
    width: 100%;
}

.secret-content > p:not(.eyebrow) {
    color: #f0e3d7;
    line-height: 1.8;
    max-width: 450px;
    margin: 0 auto;
}

.secret-content > h2 {
    color: #faf6ed;
}

.secret-content .divider {
    margin: 35px auto;
}

/* Name Selection */
#name-selection h3,
#envelope-area > h3 {
    font-size: 1.3rem;
    font-weight: normal;
    color: #d4bb88;
    margin-bottom: 25px;
}

.name-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 450px;
    margin: 0 auto;
}

.name-button {
    background: transparent;
    border: 1px solid #c8ad78;
    color: #faf6ed;
    padding: 18px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s ease;
}

.name-button:hover {
    background: #faf6ed;
    color: #792c32;
}

/* Center Last Name in Grid */
.name-button:last-child {
    grid-column: 1 / -1;
    width: 50%;
    justify-self: center;
}

/* Envelope Area */
#envelope-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* Envelope Instruction */
.envelope-instruction {
    color: #e4d5c5;
    text-align: center;
    margin-bottom: 15px;
}

/* Envelope Image Button */
.envelope-button {
    display: block;
    width: 400px;
    height: 340px;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}


.envelope-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.envelope-button:hover {
    transform: translateY(-5px);
}

/* Envelope Open Animation */
.envelope-button.open {
    animation: envelopeOpen 0.8s ease forwards;
    pointer-events: none;
}

@keyframes envelopeOpen {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
    }

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

/* Assignment Reveal Card */
.reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0px;
    max-width: 420px;
    padding: 25px 20px;
    background: #f8f4ec;
    color: #792c32;
    border: 1px solid #c8ad78;
    text-align: center;
    animation: fadeIn 1s ease;
}

.reveal p:first-child {
    color: #a17d46;
    font-size: 0.7rem;
    letter-spacing: 3px;
    line-height: 1.8;
}

.reveal h2 {
    font-size: 2.8rem;
    font-weight: normal;
    margin: 20px 0;
    color: #792c32;
}

.reveal-divider {
    color: #c8ad78;
    font-size: 1.3rem;
    margin: 15px 0;
}

.reveal h3 {
    color: #a17d46;
    font-size: 1.3rem;
    font-weight: normal;
    margin: 15px 0;
}

.reveal .christmas-message {
    color: #77716a;
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0 auto 25px;
    max-width: 300px;
}

/* Return Home Button */
.home-button {
    background: #792c32;
    color: #faf6ed;
    border: 1px solid #792c32;
    padding: 13px 22px;
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: 0.3s ease;
}

.home-button:hover {
    background: #faf6ed;
    color: #792c32;
}

/* Back to Names Button */
.back-button {
    display: block;
    align-self: center;
    margin: 20px auto 0;
    background: transparent;
    color: #d4bb88;
    border: 1px solid #c8ad78;
    padding: 12px 25px;
    font-family: inherit;
    letter-spacing: 2px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.3s ease;
}

.back-button:hover {
    background: #faf6ed;
    color: #792c32;
}

#envelope-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

#envelope-area .envelope-instruction {
    margin: 0 0 8px 0;
    padding: 0;
}

#envelope-area #reveal {
    margin: 0 auto;
    padding: 25px 20px;
    align-self: center;
}

/* Wishlist Button */
.wishlist-button {
    background: transparent;
    color: #792c32;
    border: 1px solid #792c32;
    padding: 13px 22px;
    margin-bottom: 12px;
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: 0.3s ease;
}

.wishlist-button:hover {
    background: #792c32;
    color: #faf6ed;
    border-color: #792c32;
}

.reveal .wishlist-button {
    display: block;
    margin: 0 auto 12px;
}

/* Footer */
footer {
    background: #5e2026;
    color: #d4bb88;
    text-align: center;
    padding: 25px;
    font-size: 0.65rem;
    letter-spacing: 3px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

/* Mobile Styling */
@media (max-width: 600px) {
    .welcome-content {
        padding: 40px 20px;
    }

    .family-content h2,
    .secret-content > h2 {
        font-size: 2rem;
    }

    .name-grid {
        gap: 10px;
    }

    .name-button {
        padding: 15px 8px;
    }

    .name-button:last-child {
        width: 60%;
    }

    .reveal {
        padding: 20px 15px;
    }

    .reveal h2 {
        font-size: 2.3rem;
    }

    .home-button {
        padding: 12px 15px;
    }

    .envelope-button {
        display: block;
        width: min(400px, 100%);
        height: 280px;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        position: static;
    }

    .envelope-button img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        margin: 0;
    }

    #envelope-area {
        width: 100%;
        align-items: center;
        padding: 0;
    }
}

/* Two-Card Reveal Layout */
.reveal-stage {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 420px;
    max-width: 100%;
    margin: 0 auto;
    gap: 10px;
    transition: width 2.0s ease;
}

/* Assignment Card */
.reveal-stage .reveal {
    flex: 0 0 420px;
    width: 420px;
    max-width: 100%;
    margin: 0;
    transition: transform 0.7s ease;
}

/* Wishlist Card */
.wishlist-panel {
    flex: 0 0 0;
    width: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    background: #f8f4ec;
    color: #792c32;
    border: 0 solid #c8ad78;
    text-align: center;
    transition:
        width 0.7s ease,
        opacity 0.5s ease,
        padding 0.7s ease,
        border 0.7s ease;
}

.wishlist-panel h2 {
    font-size: 2.8rem;
    font-weight: normal;
    color: #792c32;
    margin: 20px 0;
}

.wishlist-panel p {
    color: #77716a;
    line-height: 1.8;
}

/* Open Wishlist State */
.reveal-stage.wishlist-open {
    width: 840px;
}

.reveal-stage.wishlist-open .reveal {
    transform: translateX(0);
}

.reveal-stage.wishlist-open .wishlist-panel {
    flex: 0 0 420px;
    width: 420px;
    opacity: 1;
    padding: 25px 20px;
    border: 1px solid #c8ad78;
}

#reveal-stage:has(.reveal.hidden) {
    display: none;
}

#reveal-stage:has(.reveal:not(.hidden)) {
    display: flex;
}

#wishlist-content ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

#wishlist-content li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(200, 173, 120, 0.5);
    color: #77716a;
    line-height: 1.6;
}

#wishlist-content li:last-child {
    border-bottom: none;
}

#wishlist-content a {
    color: #792c32;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.3s ease;
}

#wishlist-content a:hover {
    color: #a17d46;
}

/* Mobile Layout */
@media (max-width: 600px) {
    .reveal-stage {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .reveal-stage .reveal {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* When wishlist is open, hide the reveal card */
    .reveal-stage.wishlist-open .reveal {
        display: none;
    }

    /* Show wishlist in place of reveal card */
    .reveal-stage.wishlist-open .wishlist-panel {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 20px 15px;
        opacity: 1;
        border: 1px solid #c8ad78;
    }
}
