
/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Malgun Gothic', sans-serif;
    background: #fffaf7;
    color: #574747;
    overflow-x: hidden;
}

button {
    cursor: pointer;
    font-family: inherit;
}

.hidden {
    display: none !important;
}

.main-page {
    position: relative;
    z-index: 1;
}

/* 배경 애니메이션 */
#backgroundEffects {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

.floating-effect {
    position: absolute;
    top: -50px;
    opacity: 0;
    animation: falling linear infinite;
}

@keyframes falling {
    0% {
        transform: translateY(-5vh) rotate(0deg);
        opacity: 0;
    }
    10%, 85% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* 로그인 */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #fff0f2, #fffaf3);
}

.login-box {
    background: white;
    width: 350px;
    padding: 50px 35px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 10px 40px #d9a8a830;
}

.heart {
    color: #e89aa9;
    font-size: 45px;
    margin-bottom: 15px;
}

.login-box h1 {
    font-family: Georgia, serif;
    color: #c47e8e;
    margin-bottom: 10px;
}

.login-box p {
    color: #a58b8b;
    margin-bottom: 25px;
}

.login-box input {
    width: 100%;
    padding: 15px;
    border: 1px solid #f0d9dc;
    border-radius: 12px;
    text-align: center;
    font-size: 20px;
    letter-spacing: 8px;
    outline: none;
}

.login-box input:focus {
    border-color: #d995a4;
}

.login-box button {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    border: none;
    border-radius: 12px;
    background: #d995a4;
    color: white;
    font-size: 16px;
}

.login-box button:hover {
    background: #c47e8e;
}

/* 상단 메뉴 */
header {
    height: 75px;
    padding: 0 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fffaf7;
    border-bottom: 1px solid #f4e8e4;
}

.logo {
    font-family: Georgia, serif;
    font-size: 23px;
    color: #c47e8e;
}

nav button {
    background: none;
    border: none;
    padding: 10px 15px;
    color: #806b6b;
    font-size: 14px;
    letter-spacing: 2px;
}

nav button:hover {
    color: #d58b9b;
}

/* 메인 소개 */
.intro {
    text-align: center;
    padding: 65px 20px 30px;
}

.sub-title {
    color: #d995a4;
    letter-spacing: 4px;
    font-size: 12px;
    margin-bottom: 18px;
}

.intro h1 {
    font-size: 36px;
    margin-bottom: 15px;
}

.intro > p:last-child {
    color: #a58b8b;
}

/* 작아진 D-Day */
.day-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 390px;
    margin: 0 auto 45px;
    padding: 13px 22px;
    background: #fff1f2;
    border: 1px solid #f3dfe1;
    border-radius: 50px;
}

.counter-label {
    color: #c47e8e;
    font-size: 10px;
    letter-spacing: 2px;
}

.day-number {
    color: #c47e8e;
    font-family: Georgia, serif;
    font-size: 25px;
    font-weight: bold;
    white-space: nowrap;
}

.day-counter p {
    color: #a58b8b;
    font-size: 11px;
    white-space: nowrap;
}

/* 메인 사진 */
.hero-section {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 60px;
}

.hero-photo {
    position: relative;
    height: 560px;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 15px 40px #00000015;
    background: #f5e9e7;
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.slide-in {
    animation: photoFade 0.7s ease;
}

@keyframes photoFade {
    from {
        opacity: 0.2;
        transform: scale(1.04);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 35px;
    color: white;
    background: linear-gradient(transparent, #00000090);
    pointer-events: none;
}

.photo-caption p {
    margin-bottom: 10px;
    font-size: 13px;
}

.photo-caption h2 {
    font-family: Georgia, serif;
    font-size: 28px;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: white;
    color: #c47e8e;
    font-size: 18px;
    box-shadow: 0 3px 15px #00000015;
}

.arrow:hover {
    background: #d995a4;
    color: white;
}

.arrow.left {
    left: 5px;
}

.arrow.right {
    right: 5px;
}

/* 슬라이드 표시 */
.slide-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: #e9cbd0;
    transition: 0.3s;
}

.indicator.active {
    width: 27px;
    border-radius: 10px;
    background: #d995a4;
}

/* 메인 편지 */
.intro-letter {
    text-align: center;
    padding: 85px 20px;
    line-height: 2;
}

.letter-decoration {
    font-size: 35px;
    color: #d995a4;
}

.intro-letter h2 {
    font-size: 23px;
    margin: 15px 0 25px;
}

.intro-letter p {
    color: #8d7777;
    line-height: 2.2;
}

.intro-letter span {
    display: block;
    margin-top: 25px;
    color: #c47e8e;
}

/* 타임라인 */
.memory-section {
    background: #fff3f2;
    padding: 85px 8%;
}

.section-title {
    text-align: center;
    margin-bottom: 65px;
}

.section-title p {
    color: #d995a4;
    letter-spacing: 4px;
    font-size: 12px;
    margin-bottom: 15px;
}

.section-title h2 {
    font-size: 30px;
    margin-bottom: 15px;
}

.section-title span {
    color: #a58b8b;
}

.timeline {
    max-width: 950px;
    margin: auto;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #e8bdc6;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 40px 65px;
    animation: appear 0.8s ease both;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-item::after {
    content: "♥";
    position: absolute;
    top: 5px;
    width: 34px;
    height: 34px;
    line-height: 34px;
    border-radius: 50%;
    background: #d995a4;
    color: white;
    text-align: center;
    font-size: 13px;
}

.timeline-item:nth-child(odd)::after {
    right: -17px;
}

.timeline-item:nth-child(even)::after {
    left: -17px;
}

.timeline-item h3 {
    font-size: 23px;
    margin-bottom: 8px;
}

.timeline-date {
    display: block;
    color: #d995a4;
    font-size: 13px;
    margin-bottom: 15px;
}

.timeline-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.timeline-gallery img {
    width: 100%;
    height: 175px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 5px 15px #00000010;
    transition: 0.3s;
    cursor: zoom-in;
}

.timeline-gallery img:hover {
    transform: translateY(-6px) scale(1.02);
}

.timeline-description {
    margin-top: 15px;
    color: #9b8585;
    font-size: 14px;
    line-height: 1.8;
}

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

/* 편지 페이지 */
.letter-page {
    min-height: 85vh;
    padding: 80px 20px;
    background: #fff3f2;
    text-align: center;
}

.letter-heading {
    margin-bottom: 65px;
}

.letter-heading p {
    color: #d995a4;
    letter-spacing: 4px;
    font-size: 12px;
    margin-bottom: 15px;
}

.letter-heading h1 {
    font-size: 30px;
    margin-bottom: 15px;
}

.letter-heading span {
    color: #a58b8b;
}

/* 편지 봉투 */
.envelope-container {
    display: flex;
    justify-content: center;
    perspective: 1000px;
    margin: 40px auto 30px;
}

.envelope {
    position: relative;
    width: 300px;
    height: 195px;
    cursor: pointer;
}

.envelope-back {
    position: absolute;
    inset: 0;
    background: #e6b5bd;
    border-radius: 5px;
}

.envelope-front {
    position: absolute;
    inset: 0;
    background: #efc7cd;
    clip-path: polygon(0 0, 50% 60%, 100% 0, 100% 100%, 0 100%);
    z-index: 3;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #d995a4;
    clip-path: polygon(0 0, 100% 0, 50% 58%);
    transform-origin: top;
    transition: transform 0.8s ease;
    z-index: 4;
}

.envelope-heart {
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 30px;
    z-index: 5;
}

.envelope-letter {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 5px;
    height: 170px;
    background: #fffdf8;
    z-index: 2;
    transition: transform 0.8s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mini-letter {
    color: #c47e8e;
    line-height: 2;
    font-size: 12px;
}

.mini-letter span {
    letter-spacing: 2px;
}

.mini-letter p {
    margin-top: 10px;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope.open .envelope-letter {
    transform: translateY(-120px);
    transition-delay: 0.3s;
}

.envelope.open .envelope-heart {
    opacity: 0;
}

/* 편지 버튼 */
.open-letter-button {
    padding: 14px 35px;
    background: #d995a4;
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 15px;
    transition: 0.3s;
}

.open-letter-button:hover {
    background: #c47e8e;
    transform: translateY(-3px);
}

/* 편지지 */
.letter-paper {
    max-width: 750px;
    margin: 60px auto 0;
    padding: 70px 65px;
    background: #fffdf8;
    border: 1px solid #f2e7d9;
    box-shadow: 0 10px 35px #00000010;
    text-align: left;
    line-height: 2;
    animation: letterAppear 1s ease;
}

@keyframes letterAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.letter-top {
    text-align: center;
    color: #d995a4;
    letter-spacing: 4px;
    margin-bottom: 40px;
}

.letter-paper h2 {
    font-size: 23px;
    margin-bottom: 35px;
}

.letter-content p {
    margin-bottom: 25px;
    color: #786969;
}

.letter-bottom {
    text-align: right;
    margin-top: 60px;
    color: #c47e8e;
}

.letter-bottom h2 {
    font-size: 18px;
    margin-top: 10px;
}

/* 사진 확대 */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(35, 25, 30, 0.94);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 70px;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 50px #00000050;
}

.lightbox-content p {
    color: white;
    margin-top: 20px;
    font-size: 15px;
    text-align: center;
}

.lightbox-content span {
    color: #e5b6c0;
    font-size: 12px;
    margin-top: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: #ffffff25;
    color: white;
    font-size: 20px;
}

.lightbox-arrow:hover {
    background: #d995a4;
}

.lightbox-arrow.left {
    left: 25px;
}

.lightbox-arrow.right {
    right: 25px;
}

/* 하단 */
footer {
    text-align: center;
    padding: 40px 20px;
    color: #b39b9b;
    font-size: 12px;
    line-height: 2;
}

/* 모바일 */
@media (max-width: 600px) {
    header {
        padding: 0 5%;
    }

    .logo {
        font-size: 18px;
    }

    .intro h1 {
        font-size: 27px;
    }

    .day-counter {
        gap: 9px;
        max-width: 340px;
        padding: 12px 15px;
        margin-bottom: 35px;
    }

    .counter-label {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .day-number {
        font-size: 21px;
    }

    .day-counter p {
        font-size: 9px;
    }

    .hero-section {
        padding: 0 35px;
    }

    .hero-photo {
        height: 350px;
    }

    .arrow {
        width: 35px;
        height: 35px;
    }

    .photo-caption {
        padding: 20px;
    }

    .memory-section {
        padding: 60px 5%;
    }

    .timeline::before {
        left: 12px;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding: 0 0 55px 40px;
        text-align: left;
    }

    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: -4px;
        right: auto;
    }

    .timeline-gallery img {
        height: 130px;
    }

    .letter-page {
        padding: 60px 15px;
    }

    .letter-paper {
        padding: 40px 25px;
    }

    .letter-paper h2 {
        font-size: 19px;
    }

    .lightbox {
        padding: 50px 45px;
    }

    .lightbox-arrow {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .lightbox-arrow.left {
        left: 5px;
    }

    .lightbox-arrow.right {
        right: 5px;
    }

    .lightbox-close {
        right: 15px;
        top: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =====================================
   타임라인 사진 슬라이드 앨범
   화살표와 인디케이터를 사진 바깥에 배치
===================================== */

.memory-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.memory-photo-frame {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #f5e9e7;
    box-shadow: 0 5px 18px #00000012;
}

.memory-photo-frame img {
    display: block;
    width: 100%;
    height: 290px;
    object-fit: cover;
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

/* 사진 바깥 좌우 화살표 */
.memory-arrow {
    position: static;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #c47e8e;
    font-size: 27px;
    line-height: 1;
    box-shadow: 0 3px 12px #00000012;
    transition: background 0.25s, color 0.25s, transform 0.25s;
}

.memory-arrow:hover {
    background: #d995a4;
    color: white;
    transform: scale(1.08);
}

/* 사진 바깥 아래 원형 인디케이터 */
.memory-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

/* 메인 사진첩과 같은 인디케이터 디자인을 사용 */
.memory-indicators .indicator {
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    .memory-slider {
        gap: 7px;
    }

    .memory-photo-frame img {
        height: 230px;
    }

    .memory-arrow {
        flex-basis: 31px;
        width: 31px;
        height: 31px;
        font-size: 23px;
    }

    .memory-indicators {
        gap: 9px;
        margin-top: 15px;
    }
}
