/* =========================================================
   BASIC
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: #f8f4ef;
    color: #302a2a;
    font-family: "DM Sans", sans-serif;
    overflow: hidden;
}


/* =========================================================
   PAGE SYSTEM
========================================================= */

.page {
    position: fixed;
    inset: 0;

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    padding: 60px 24px 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f8f4ef;

    opacity: 0;
    visibility: hidden;
    transform: translateX(35px);

    transition:
        opacity 0.55s ease,
        transform 0.55s ease,
        visibility 0.55s ease;

    overflow-y: auto;
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 5;
}


/* =========================================================
   PAGE NUMBER
========================================================= */

.page-number {
    position: absolute;
    top: 24px;
    right: 24px;

    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;

    color: #a3938d;
}


/* =========================================================
   OPENING
========================================================= */

#page1 {
    background:
        radial-gradient(
            circle at 50% 25%,
            #fffdfb 0%,
            #f8f4ef 55%,
            #f0e8e1 100%
        );
}

.opening-content {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.opening-decoration {
    position: absolute;

    top: 13%;
    left: 50%;

    transform: translateX(-50%);

    font-family: "Playfair Display", serif;
    font-size: 100px;

    color: #c9aaa0;
    opacity: 0.22;

    animation: heartbeat 3s ease-in-out infinite;
}

.small-text {
    margin-bottom: 18px;

    color: #9a8983;

    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.opening-content h1 {
    position: relative;

    font-family: "Playfair Display", serif;

    font-size: clamp(52px, 15vw, 78px);
    font-weight: 500;
    line-height: 0.95;

    color: #302a2a;
}

.opening-content h1 span {
    color: #9a5f62;
}

.opening-description {
    margin-top: 28px;

    color: #756b68;

    font-size: 14px;
    line-height: 1.8;
}

.main-button {
    margin-top: 38px;

    border: none;
    border-radius: 100px;

    padding: 15px 24px;

    background: #302a2a;
    color: #fff;

    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    box-shadow: 0 12px 30px rgba(48, 42, 42, 0.16);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.main-button span {
    margin-right: 7px;
}

.main-button:active {
    transform: scale(0.96);
}

.hint {
    margin-top: 14px;

    color: #a99b95;

    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.bottom-note {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;

    text-align: center;

    color: #aa9d97;

    font-size: 10px;
    letter-spacing: 1.5px;
}


/* =========================================================
   COMMON STORY
========================================================= */

.story-content,
.timeline-content,
.letter-content {
    width: 100%;
    max-width: 470px;
}

.section-label {
    display: inline-block;

    margin-bottom: 18px;

    color: #9a5f62;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.story-content h2,
.timeline-content h2,
.letter-content h2,
.memory-content h2,
.final-content h2 {

    font-family: "Playfair Display", serif;

    font-size: clamp(34px, 9vw, 48px);
    font-weight: 500;
    line-height: 1.08;

    color: #302a2a;
}

.story-content p {
    margin-top: 25px;

    color: #706765;

    font-size: 14px;
    line-height: 1.9;
}

.simple-line {
    width: 42px;
    height: 1px;

    margin-top: 27px;

    background: #b58d87;
}

.highlight-text {
    color: #9a5f62 !important;

    font-family: "Playfair Display", serif;

    font-size: 18px !important;
    line-height: 1.6 !important;
}

.text-button {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 34px;

    padding: 0;

    border: none;
    background: transparent;

    color: #302a2a;

    font-family: "DM Sans", sans-serif;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.text-button span {
    font-size: 18px;

    transition: transform 0.25s ease;
}

.text-button:active span {
    transform: translateX(5px);
}


/* =========================================================
   QUOTE
========================================================= */

.quote {
    margin-top: 32px;
    padding: 20px 0;

    border-top: 1px solid #ded4ce;
    border-bottom: 1px solid #ded4ce;

    color: #302a2a;

    font-family: "Playfair Display", serif;

    font-size: 20px;
    line-height: 1.55;
}


/* =========================================================
   MEMORY / GALLERY
========================================================= */

.memory-content {
    width: 100%;
    max-width: 470px;
}

.memory-intro {
    margin-top: 15px;

    color: #817572;

    font-size: 13px;
    line-height: 1.7;
}

.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 28px;
}

.photo-frame {
    position: relative;

    height: 145px;

    overflow: hidden;

    background: #e9dfd8;
}

.photo-frame.large {
    height: 190px;
}

.photo-frame.wide {
    grid-column: span 2;
    height: 120px;
}

.photo-placeholder {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #eee5df,
            #e5d7cf
        );

    color: #a88f88;

    transition: transform 0.4s ease;
}

.photo-placeholder span {
    margin-bottom: 7px;

    font-family: "Playfair Display", serif;

    font-size: 32px;

    opacity: 0.65;
}

.photo-placeholder small {
    font-size: 9px;

    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.photo-frame:active .photo-placeholder {
    transform: scale(1.03);
}


/* =========================================================
   TIMELINE
========================================================= */

.timeline {
    position: relative;

    margin-top: 35px;
    padding-left: 24px;
}

.timeline::before {
    content: "";

    position: absolute;

    top: 5px;
    bottom: 5px;
    left: 4px;

    width: 1px;

    background: #d7c9c2;
}

.timeline-item {
    position: relative;

    margin-bottom: 30px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;

    top: 4px;
    left: -24px;

    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: #9a5f62;

    box-shadow:
        0 0 0 5px #f8f4ef,
        0 0 0 6px #d7c9c2;
}

.timeline-date {
    color: #9a5f62;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1.5px;
}

.timeline-item h3 {
    margin-top: 7px;

    color: #302a2a;

    font-family: "Playfair Display", serif;

    font-size: 20px;
    font-weight: 500;
}

.timeline-item p {
    margin-top: 7px;

    color: #817572;

    font-size: 12px;
    line-height: 1.7;
}


/* =========================================================
   LETTER
========================================================= */

.letter-content {
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: none;
}

.letter-content::-webkit-scrollbar {
    display: none;
}

.letter-paper {
    margin-top: 25px;
    padding: 28px 22px;

    background: #fffdf9;

    border: 1px solid #e8ded6;

    box-shadow:
        0 14px 40px rgba(69, 52, 47, 0.06);
}

.letter-paper p {
    margin-bottom: 17px;

    color: #6f6561;

    font-family: "Playfair Display", serif;

    font-size: 14px;
    line-height: 1.9;
}

.letter-paper .letter-greeting {
    color: #302a2a;

    font-size: 20px;
}

.letter-paper .letter-ending {
    margin-top: 25px;
    margin-bottom: 0;

    color: #9a5f62;

    font-size: 18px;
}


/* =========================================================
   FINAL
========================================================= */

.final-page {
    background:
        radial-gradient(
            circle at center,
            #fffaf7 0%,
            #f5ebe5 100%
        );
}

.final-content {
    width: 100%;
    max-width: 420px;

    text-align: center;
}

.final-heart {
    margin-bottom: 15px;

    color: #b07878;

    font-family: "Playfair Display", serif;

    font-size: 55px;

    animation: heartbeat 2.5s ease-in-out infinite;
}

.final-content p {
    margin-top: 18px;

    color: #817572;

    font-size: 13px;
}

.answer-buttons {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 12px;

    min-height: 110px;

    margin-top: 22px;
}

.yes-button,
.no-button {
    border: none;
    border-radius: 100px;

    padding: 13px 19px;

    font-family: "DM Sans", sans-serif;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}

.yes-button {
    background: #302a2a;
    color: white;
}

.no-button {
    background: #e8ddd7;
    color: #675956;

    transition:
        left 0.2s ease,
        top 0.2s ease;
}

.answer-message {
    min-height: 25px;

    color: #9a5f62 !important;

    font-family: "Playfair Display", serif;

    font-size: 18px !important;
}


/* =========================================================
   FLOATING HEARTS
========================================================= */

.floating-hearts {
    position: fixed;

    inset: 0;

    pointer-events: none;

    overflow: hidden;

    z-index: 20;
}

.heart {
    position: absolute;

    bottom: -30px;

    color: #b78383;

    font-size: 16px;

    opacity: 0;

    animation: floatHeart 4s linear forwards;
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes heartbeat {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.08);
    }
}

@keyframes floatHeart {

    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    15% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(-110vh) rotate(25deg);
        opacity: 0;
    }
}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-height: 700px) {

    .page {
        padding-top: 48px;
        padding-bottom: 35px;
    }

    .opening-content h1 {
        font-size: 48px;
    }

    .opening-description {
        margin-top: 18px;
    }

    .main-button {
        margin-top: 25px;
    }

    .story-content p {
        margin-top: 18px;
    }

    .photo-frame {
        height: 120px;
    }

    .photo-frame.large {
        height: 155px;
    }

    .photo-frame.wide {
        height: 100px;
    }

}


/* =========================================================
   TABLET / DESKTOP
========================================================= */

@media (min-width: 700px) {

    .page {
        padding-left: 40px;
        padding-right: 40px;
    }

    .main-button:hover {
        transform: translateY(-3px);

        box-shadow:
            0 17px 35px rgba(48, 42, 42, 0.2);
    }

    .text-button:hover span {
        transform: translateX(5px);
    }

}