/* RESET */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* PAGE */

body {
    min-height: 100vh;
    background-color: #25282c;
    color: #eee9e1;
    font-family: Georgia, serif;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 25px;
}

/* OPENING CONTAINER */

.opening-container {
    max-width: 650px;
    width: 100%;
    text-align: center;

    animation: fadeIn 1.5s ease;
}

/* SMALL HEADING */

.eyebrow {
    font-family: Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 4px;
    color: #a69b8b;
}

/* DIVIDER */

.divider {
    width: 45px;
    height: 1px;
    background-color: #a69b8b;
    margin: 35px auto;
}

/* MAIN HEADING */

h1 {
    font-size: clamp(34px, 6vw, 52px);
    font-weight: normal;
    line-height: 1.3;
    margin-bottom: 25px;
}

/* INTRODUCTION */

.introduction {
    max-width: 430px;
    margin: 0 auto 35px;

    color: #b9b4ac;
    font-size: 16px;
    line-height: 1.9;
}

/* BUTTON */

button {
    background: transparent;
    border: 1px solid #a69b8b;
    color: #eee9e1;

    padding: 15px 28px;

    font-size: 14px;
    letter-spacing: 1px;

    cursor: pointer;

    transition: all 0.3s ease;
}

button span {
    margin-left: 12px;
}

button:hover {
    background-color: #eee9e1;
    color: #25282c;
}

/* FOOTER */

.footer-note {
    margin-top: 65px;

    font-family: Arial, sans-serif;
    font-size: 9px;
    letter-spacing: 2px;

    color: #777a7c;
}

/* ANIMATION */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* LETTER SCREEN */

.letter-container {
    max-width: 680px;
    width: 100%;
    padding: 50px 30px;

    text-align: center;

    animation: fadeIn 1s ease;
}

.letter-container h2 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: normal;
    line-height: 1.4;

    margin-bottom: 40px;
}

.letter-text {
    color: #c5c0b8;

    font-size: 17px;
    line-height: 2.1;

    text-align: left;
    white-space: pre-line;
}

.signature {
    margin-top: 50px;

    color: #a69b8b;
    font-style: italic;

    text-align: right;
}

/* HIDDEN ELEMENT */

.hidden {
    display: none;
}

/* SCREEN TRANSITION */

.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* WARM PAPER LETTER DESIGN */

body {
    background-color: #25282c;
}

/* The paper itself */

.letter-container {
    max-width: 720px;
    width: 100%;

    background-color: #f1eadd;
    color: #39352f;

    padding: 65px 70px;
    margin: 40px auto;

    border: 1px solid #d8cdbb;

    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);

    text-align: center;

    animation: fadeIn 1s ease;
}

/* Small heading */

.letter-container .eyebrow {
    color: #8c7c68;
}

/* Divider */

.letter-container .divider {
    background-color: #b7a58d;
}

/* Main heading */

.letter-container h2 {
    color: #39352f;

    font-size: clamp(28px, 5vw, 40px);
    font-weight: normal;
    line-height: 1.4;

    margin-bottom: 40px;
}

/* Letter text */

.letter-text {
    color: #514a41;

    font-size: 17px;
    line-height: 2.1;

    text-align: left;
    white-space: pre-line;
}

/* Signature */

.signature {
    margin-top: 50px;

    color: #8c7c68;
    font-style: italic;

    text-align: right;
}

/* Mobile adjustments */

@media (max-width: 600px) {
    .letter-container {
        padding: 40px 25px;
    }
}

/* INTERACTIVE REVEAL SECTION */

.reveal-container {
    margin-top: 55px;
}

.reveal-button {
    color: #766650;
    border: 1px solid #b7a58d;

    padding: 13px 20px;

    font-family: Georgia, serif;
    font-size: 14px;
    letter-spacing: 0;

    transition: all 0.3s ease;
}

.reveal-button:hover {
    background-color: #e2d7c5;
    color: #39352f;
}

.reveal-button span {
    margin-left: 10px;
}

.hidden-message {
    margin-top: 30px;

    color: #514a41;
    font-size: 17px;
    line-height: 2.1;

    text-align: left;

    animation: fadeIn 0.8s ease;
}

.hidden-message .divider {
    margin: 25px auto;
}

/* SCROLL REVEAL ANIMATION */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);

    transition:
        opacity 1s ease,
        transform 1s ease;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* PAUSE AND CONTINUE */

.pause-container {
    margin-top: 65px;
    text-align: center;
}

.pause-text {
    color: #8c7c68;
    font-size: 15px;
    font-style: italic;
    margin-bottom: 25px;
}

.continue-button {
    color: #766650;
    border: 1px solid #b7a58d;

    padding: 13px 24px;

    font-family: Georgia, serif;
    font-size: 14px;
    letter-spacing: 0;

    transition: all 0.3s ease;
}

.continue-button:hover {
    background-color: #e2d7c5;
    color: #39352f;
}

.continue-button span {
    margin-left: 10px;
}

.next-section {
    margin-top: 30px;

    color: #514a41;
    font-size: 17px;
    line-height: 2.1;

    text-align: left;

    animation: fadeIn 0.8s ease;
}

/* LETTER READABILITY */

.letter-text p,
.letter-section p,
.hidden-message p,
.next-section p {
    margin-bottom: 25px;
}

/* Slightly improve the reading width */

.letter-text,
.letter-section,
.hidden-message,
.next-section {
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

/* Comfortable paragraph typography */

.letter-text,
.letter-section p,
.hidden-message p,
.next-section p {
    font-size: 17px;
    line-height: 2;
    letter-spacing: 0.1px;
}

/* LETTER CLOSING */

.letter-closing {
    margin-top: 70px;
    padding-top: 20px;
    text-align: center;
}

.closing-text {
    color: #514a41;
    font-size: 17px;
    line-height: 2;
    margin-bottom: 35px;
}

.letter-closing .signature {
    margin-top: 30px;
    color: #8c7c68;
    font-size: 17px;
    font-style: italic;
    text-align: right;
}

/* NATURAL LETTER PAGE POSITIONING */

body:has(.letter-container:not(.hidden)) {
    align-items: flex-start;
}

.letter-container {
    flex-shrink: 0;
}

/* BUTTON TRANSITIONS */

.reveal-button,
.continue-button {
    opacity: 1;
    transition:
        opacity 0.4s ease,
        background-color 0.3s ease,
        color 0.3s ease;
}

.reveal-button:active,
.continue-button:active {
    transform: scale(0.98);
}

/* RESPONSIVE DESIGN */

@media (max-width: 600px) {

    body {
        padding: 15px;
    }

    .letter-container {
        padding: 35px 22px;
        margin: 15px auto;
    }

    .letter-container h2 {
        font-size: 28px;
    }

    .letter-text,
    .letter-section p,
    .hidden-message,
    .next-section,
    .closing-text {
        font-size: 16px;
        line-height: 1.9;
    }

    .reveal-button,
    .continue-button {
        max-width: 100%;
        padding: 12px 15px;
        font-size: 13px;
    }

    .letter-closing {
        margin-top: 50px;
    }

}

/* FINAL MESSAGE */

.letter-ending {
    margin-top: 65px;
    padding: 25px 0 15px;

    text-align: center;
}

.letter-ending p {
    color: #8c7c68;

    font-size: 15px;
    font-style: italic;
    line-height: 1.9;
}