@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css");

/* =========================
   BASE
========================= */
body {
    font-family: "Pretendard Variable", Pretendard, -apple-system,
        BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue",
        "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR",
        "Malgun Gothic", sans-serif;

    margin: 0;
    background-color: #D5D5DA;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

/* =========================
   ENVELOPE
========================= */
.envelope {
    position: relative;
    width: 507px;
    height: 338px;
    background: #FF0019;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    perspective: 1000px;
}

/* ===== 봉투 뚜껑 ===== */
.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 254px solid transparent;
    border-right: 254px solid transparent;
    border-top: 156px solid #E60017;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    transform-origin: top center;
    transform: rotateX(0deg);
    transition: transform 1s ease-in-out;
}

/* PC hover */
.envelope:hover .flap {
    transform: rotateX(-120deg) translateZ(5px);
}

/* 모바일 클릭/터치 */
.envelope.open .flap {
    transform: rotateX(-120deg) translateZ(5px);
}

/* =========================
   POSTCARD
========================= */
.postcard {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 468px;
    height: 286px;
    overflow: hidden;
    background: white;
    border-radius: 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: transform 1s 0.5s ease-in-out,
                opacity 1s 0.5s ease-in-out;
}

/* PC hover */
.envelope:hover .postcard {
    transform: translate(-50%, -50%) translateY(-60%) scale(1);
    opacity: 1;
}

/* 모바일 클릭/터치 */
.envelope.open .postcard {
    transform: translate(-50%, -50%) translateY(-60%) scale(1);
    opacity: 1;
}

/* =========================
   MESSAGE
========================= */
.message {
    padding: 20px;
    text-align: left;
    font-size: 18px;    
    line-height: 1.5;    
    font-weight: 400;   
    letter-spacing: 0;  
    word-break: break-word;
    color: #505050;

    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.message p {
    margin: 1em 0;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 480px) {
    .envelope {
        width: calc(100vw - 54px);
        height: calc((100vw - 54px) * 0.67);
        border-radius: 4px;
    }

    .flap {
        border-left: calc((100vw - 54px) / 2) solid transparent;
        border-right: calc((100vw - 54px) / 2) solid transparent;
        border-top: calc((100vw - 54px) * 0.33) solid #E31B0C;
    }

    .postcard {
        width: calc(100vw - 72px);
        height: 200px;
    }

    .message {
        font-size: 15px;   
        line-height: 1.5;
        padding: 16px;
    }
}

/* =========================
   LINKS
========================= */
.link_color {
    color: #FF0019;
}

a,
a:visited,
a:active,
a:focus {
    color: #FF0019 !important;
    -webkit-text-fill-color: #FF0019;
}
