@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400..900&family=Cormorant:ital,wght@0,300..700;1,300..700&family=Great+Vibes&display=swap');


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

:root {
    --bg-color: #dceeff;
    --card-bg: #f8fbff;
    --text-color: #0b2856;
    --accent-blue: #4f7eb8;
    --dark-blue: #00335a;
    --soft-blue: #dbeaff;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.8), transparent 40%),
        radial-gradient(circle at bottom right, rgba(183, 220, 255, 0.8), transparent 40%),
        linear-gradient(135deg, #ecf6ff, #d4ecff);
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Great Vibes", cursive;
    color: var(--text-color);

    font-weight: 400;
}

p, a {
    font-family: "Cormorant", serif;
    color: var(--text-color);
    line-height: 1.5;
}



/* =========================
   POSTCARD
========================= */

.scene {
    width: min(680px, 100%);
    aspect-ratio: 3 / 2;
    perspective: 1400px;
    cursor: pointer;
    user-select: none;
}

.postcard {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.1s cubic-bezier(0.645, 0.045, 0.355, 1);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.122),
        0 8px 24px rgba(0,0,0,0.15);
    width: 100%;
    height: 100%;
}

.postcard.flipped {
    transform: rotateY(180deg);
}

.postcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

/* =========================
   FRONT
========================= */

.postcard-front {
    background: #000;
}

.postcard-img {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,0.08),
            rgba(36,58,94,0.65)
        ),
        url('c-j.png')
        center/cover no-repeat;
}

.postcard-img-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    text-align: center;
    padding: 2rem;
}

.postcard-img-overlay h1 {
    color: white;
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: .5rem;
}

.flip-hint {
    font-size: .7rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: rgba(255,255,255,.8);
}

/* =========================
   BACK
========================= */

.postcard-back {
    transform: rotateY(180deg);

    background:
        linear-gradient(
            rgba(248,251,255,.97),
            rgba(242,248,255,.97)
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0 34px,
            rgba(79,126,184,.08) 35px
        );

    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 1.5rem;
    padding: 2rem;
}

.postcard-message {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-right: 1px solid rgba(79,126,184,.15);
    padding-right: 1.5rem;
}

.postcard-message p {
    margin-bottom: .75rem;
    color: var(--text-color);
    line-height: 1.5;
}

.postcard-message h2 {
    margin-bottom: .75rem;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: var(--accent-blue);
}

.postcard-message time {
    font-family: "Cinzel", serif;
    display: block;
    margin: .5rem 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--dark-blue);
}

.location {
    font-family: "Cinzel", serif;
    display: block;
    margin-bottom: 1rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    font-size: .75rem;
    color: #5b7091;
}

/* =========================
   BUTTONS
========================= */

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

.calendar-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;

    text-decoration: none;

    padding: .75rem 1rem;
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;

    transition: .25s ease;
}

.calendar-links a:hover {
    transform: translateY(-2px);
}

.calendar-link-google {
    background: var(--soft-blue);
    color: var(--text-color);
}

.calendar-link-apple {
    background: var(--dark-blue);
    color: white;
}

/* =========================
   STAMP
========================= */

.stamp-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.stamp {
    position: relative;
    width: 72px;
    height: 88px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: linear-gradient(
        135deg,
        #d9ebff,
        #bcd9ff
    );

    box-shadow:
        0 0 0 2px #ffffff,
        0 0 0 3px rgba(79,126,184,.15);
}

.stamp::before {
    content: "";
    position: absolute;
    inset: -5px;

    background:
        radial-gradient(circle at 0% 50%, #fff 3px, transparent 3px) repeat-y left,
        radial-gradient(circle at 100% 50%, #fff 3px, transparent 3px) repeat-y right,
        radial-gradient(circle at 50% 0%, #fff 3px, transparent 3px) repeat-x top,
        radial-gradient(circle at 50% 100%, #fff 3px, transparent 3px) repeat-x bottom;

    background-size:
        100% 7px,
        100% 7px,
        7px 100%,
        7px 100%;
}

.stamp-inner {
    display: flex;
    justify-content: center;
    align-items: center;

    width: calc(100% - 12px);
    height: calc(100% - 12px);

    border: 1px solid rgba(79,126,184,.2);

    background: linear-gradient(
        135deg,
        #eef6ff,
        #dbeaff
    );
}

.stamp-initials {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

/* =========================
   MOBILE
========================= */

@media (max-width: 767px) {

    .scene {
        max-width: 400px;
        aspect-ratio: 2 / 3;
    }

    .postcard-back {
        display: flex;
        padding: 1.5rem;
    }

    .postcard-message {
        border-right: none;
        padding-right: 0;
    }

    .stamp-container {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .stamp {
        width: 54px;
        height: 66px;
    }

    .calendar-links a {
        width: 100%;
    }
}