/* =========================
   RESET & GLOBAL
========================= */

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

[hidden] {
    display: none !important;
}

:root {
    --cream: #eee4d5;
    --paper: #fbf5e9;
    --paper-dark: #e8d9c3;
    --brown: #654a3b;
    --brown-light: #96745f;
    --rose: #a56f68;
    --gold: #b49a70;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 15%, #f8f0e4 0%, transparent 35%),
        radial-gradient(ellipse at 85% 80%, #d9c6ad 0%, transparent 38%),
        var(--cream);
    color: var(--brown);
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    opacity: 0.12;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
}


/* =========================
   PASSWORD COVER
========================= */

.password-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 18px;
}

.cover-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 55px 35px 35px;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(255,255,255,.45), transparent 50%),
        #f4eadb;
    border: 1px solid #cdb99d;
    outline: 1px solid rgba(180,154,112,.55);
    outline-offset: 8px;
    box-shadow: 0 20px 55px rgba(87,62,43,.14);
}

.cover-card::before,
.cover-card::after {
    content: "✧";
    position: absolute;
    color: var(--gold);
    font-size: 24px;
}

.cover-card::before {
    top: 15px;
    left: 17px;
}

.cover-card::after {
    right: 17px;
    bottom: 12px;
}

.cover-top {
    display: flex;
    justify-content: center;
    gap: 35px;
    color: var(--gold);
    font-size: 19px;
    margin-bottom: 28px;
}

.eyebrow {
    font-size: 9px;
    letter-spacing: 4px;
    color: var(--brown-light);
}

.cover-ornament {
    font-family: 'Cormorant Garamond', serif;
    color: var(--rose);
    font-size: 43px;
    margin: 20px 0 5px;
}

.cover-card h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(39px, 9vw, 52px);
    font-weight: 400;
    color: var(--brown);
}

.cover-script {
    font-family: 'Great Vibes', cursive;
    font-size: 34px;
    color: var(--rose);
    margin-top: 2px;
}

.cover-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 25px 0;
    color: var(--rose);
}

.cover-divider::before,
.cover-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #d8c6ad;
}

.cover-description {
    max-width: 270px;
    margin: 0 auto 28px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    line-height: 1.5;
    color: #856b56;
}

#passwordForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#passwordInput {
    width: 100%;
    padding: 14px;
    border: 1px solid #d5c2a8;
    background: rgba(255,255,255,.48);
    color: var(--brown);
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    text-align: center;
    outline: none;
}

#passwordInput:focus {
    border-color: var(--rose);
}

#passwordForm button,
.open-button {
    border: 1px solid #765747;
    background: #765747;
    color: #fff8ec;
    padding: 14px 22px;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: .3s ease;
}

#passwordForm button:hover,
.open-button:hover {
    background: #5e4336;
    transform: translateY(-2px);
}

#passwordForm button span {
    color: #e6c5b9;
}

.password-error {
    min-height: 20px;
    margin-top: 12px;
    color: #a34e43;
    font-size: 11px;
}

.cover-footer {
    margin-top: 32px;
    font-size: 8px;
    letter-spacing: 2px;
    color: #a58d73;
}


/* =========================
   MAIN SCRAPBOOK
========================= */

.main-page {
    min-height: 100vh;
    padding: 55px 18px;
}

.scrapbook {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 65px 45px 35px;
    background:
        linear-gradient(rgba(255,255,255,.23), rgba(255,255,255,.23)),
        #f0e5d5;
    border: 1px solid #cbb69a;
    box-shadow:
        0 18px 55px rgba(76,54,39,.13),
        inset 0 0 35px rgba(172,139,105,.10);
}

.scrapbook::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(174,145,111,.55);
    pointer-events: none;
}

.corner {
    position: absolute;
    z-index: 1;
    color: var(--gold);
    font-size: 28px;
}

.corner-tl {
    top: 20px;
    left: 23px;
}

.corner-tr {
    top: 20px;
    right: 23px;
}

.corner-bl {
    bottom: 20px;
    left: 23px;
}

.corner-br {
    bottom: 20px;
    right: 23px;
}


/* =========================
   HEADER
========================= */

.page-header {
    text-align: center;
    position: relative;
    z-index: 2;
}

.page-header .eyebrow {
    margin-bottom: 20px;
}

.tiny-stars {
    color: var(--gold);
    font-size: 13px;
    margin-bottom: 12px;
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(35px, 7vw, 55px);
    color: var(--brown);
}

.header-script {
    margin-top: 8px;
    font-family: 'Great Vibes', cursive;
    font-size: clamp(25px, 5vw, 34px);
    color: var(--rose);
}

.date-ribbon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    width: fit-content;
    margin: 25px auto 0;
    padding: 9px 20px;
    border-top: 1px solid #cdb99d;
    border-bottom: 1px solid #cdb99d;
    font-size: 9px;
    letter-spacing: 2px;
    color: #886d56;
}

.date-ribbon span:first-child,
.date-ribbon span:last-child {
    font-family: 'Playfair Display', serif;
}


/* =========================
   MEMORY DECORATIONS
========================= */

.memory-strip {
    max-width: 410px;
    margin: 45px auto 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.memory-note {
    width: 125px;
    min-height: 78px;
    padding: 12px 8px;
    background: #f9f1e5;
    border: 1px solid #ddcbb1;
    box-shadow: 2px 5px 10px rgba(76,54,39,.09);
    text-align: center;
    transform: rotate(-5deg);
}

.note-right {
    transform: rotate(5deg);
}

.memory-note span {
    color: var(--rose);
    font-size: 17px;
}

.memory-note p {
    margin-top: 5px;
    font-family: 'Great Vibes', cursive;
    font-size: 20px;
    color: #896b57;
}

.pressed-flower {
    color: #a8786e;
    font-size: 48px;
    opacity: .8;
    text-shadow: 1px 3px 4px rgba(87,62,43,.12);
}


/* =========================
   ENVELOPE
========================= */

.envelope-section {
    text-align: center;
    padding: 15px 0 25px;
}

.envelope-caption {
    font-size: 9px;
    letter-spacing: 3px;
    color: #a0876d;
    margin-bottom: 25px;
}

.envelope-wrapper {
    width: 270px;
    height: 185px;
    margin: 0 auto 35px;
    perspective: 1000px;
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.envelope-back {
    position: absolute;
    inset: 0;
    background: #b99879;
    border: 1px solid #a88768;
    z-index: 1;
}

.letter-inside {
    position: absolute;
    top: 8px;
    left: 6%;
    width: 88%;
    height: 165px;
    background: #fff9ed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    color: #80604d;
    transition: transform 1s ease;
    z-index: 2;
    box-shadow: 0 2px 9px rgba(70,48,32,.12);
}

.inside-heart {
    color: var(--rose);
    font-size: 23px;
}

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

.envelope-flap {
    position: absolute;
    inset: 0;
    background: #d3b797;
    clip-path: polygon(0 0, 100% 0, 50% 59%);
    transform-origin: top center;
    transition: transform .85s ease;
    z-index: 4;
}

.wax-seal {
    position: absolute;
    z-index: 5;
    top: 75px;
    left: calc(50% - 20px);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #89564f;
    color: #f8e9dc;
    border: 2px solid #a9776b;
    font-family: 'Playfair Display', serif;
    font-size: 21px;
    box-shadow: 0 3px 8px rgba(70,48,32,.2);
    transition: opacity .3s ease;
}

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

.envelope.open .letter-inside {
    transform: translateY(-110px);
}

.envelope.open .wax-seal {
    opacity: 0;
}

.open-button span {
    color: #e8c6b9;
}

.small-hint {
    margin-top: 15px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-style: italic;
    color: #a18a70;
}


/* =========================
   LETTER
========================= */

.letter-content {
    display: none;
    max-width: 550px;
    margin: 35px auto 15px;
    animation: letterAppear 1.2s ease both;
}

.paper {
    position: relative;
    padding: 42px 38px;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(197,167,128,.13), transparent 45%),
        #fff9ed;
    border: 1px solid #ddc9ac;
    box-shadow:
        0 12px 30px rgba(75,53,38,.12),
        inset 0 0 25px rgba(176,143,105,.08);
}

.paper::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(191,164,128,.4);
    pointer-events: none;
}

.paper-top-decoration,
.paper-bottom-decoration {
    text-align: center;
    color: #b18b76;
    letter-spacing: 15px;
    font-size: 19px;
}

.letter-date {
    margin: 25px 0 15px;
    text-align: center;
    font-size: 9px;
    letter-spacing: 3px;
    color: #a18a70;
}

.paper h2 {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 29px;
    color: #694d3e;
    margin-bottom: 30px;
}

.letter-body {
    position: relative;
    z-index: 1;
    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    line-height: 1.8;
    color: #654d3e;
    white-space: pre-line;
}

.letter-signature {
    position: relative;
    z-index: 1;
    margin-top: 35px;
    text-align: right;
    color: #86604f;
}

.letter-signature p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
}

.letter-signature span {
    font-family: 'Great Vibes', cursive;
    font-size: 31px;
}

.paper-bottom-decoration {
    margin-top: 35px;
    font-size: 14px;
}


/* =========================
   FOOTER
========================= */

.page-footer {
    margin-top: 45px;
    text-align: center;
}

.footer-line {
    width: 100px;
    height: 1px;
    margin: 0 auto 17px;
    background: #cbb69a;
}

.page-footer p {
    font-size: 8px;
    letter-spacing: 3px;
    color: #9c8169;
}

.page-footer span {
    display: block;
    margin-top: 10px;
    font-family: 'Great Vibes', cursive;
    font-size: 23px;
    color: var(--rose);
}


/* =========================
   ANIMATIONS
========================= */

@keyframes letterAppear {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


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

@media (max-width: 600px) {

    .main-page {
        padding: 25px 12px;
    }

    .scrapbook {
        padding: 55px 22px 30px;
    }

    .scrapbook::before {
        inset: 8px;
    }

    .corner-tl {
        top: 13px;
        left: 15px;
    }

    .corner-tr {
        top: 13px;
        right: 15px;
    }

    .corner-bl {
        bottom: 13px;
        left: 15px;
    }

    .corner-br {
        bottom: 13px;
        right: 15px;
    }

    .memory-strip {
        gap: 8px;
        margin: 35px auto 25px;
    }

    .memory-note {
        width: 105px;
        min-height: 70px;
    }

    .pressed-flower {
        font-size: 37px;
    }

    .envelope-wrapper {
        width: 235px;
        height: 165px;
    }

    .envelope.open .letter-inside {
        transform: translateY(-95px);
    }

    .wax-seal {
        top: 65px;
    }

    .paper {
        padding: 35px 24px;
    }

    .paper h2 {
        font-size: 25px;
    }

    .letter-body {
        font-size: 17px;
        line-height: 1.85;
    }

    .cover-card {
        padding: 45px 24px 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
/* DENVIS PHOTO GALLERY */

.photo-gallery {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 65px 15px 75px;
    margin: 15px auto 35px;
    flex-wrap: wrap;
}

.gallery-caption {
    width: 100%;
    text-align: center;
    font-family: 'Great Vibes', cursive;
    font-size: 32px;
    color: var(--brown);
    margin-bottom: 15px;
}

.polaroid {
    background: #fffdf7;
    padding: 12px 12px 35px;
    width: 185px;
    box-shadow: 0 8px 22px rgba(65, 43, 30, 0.16);
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
}

.polaroid img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.polaroid span {
    display: block;
    margin-top: 13px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 15px;
    color: var(--brown);
}

.polaroid-left {
    transform: rotate(-7deg);
}

.polaroid-main {
    width: 215px;
    transform: rotate(2deg);
    z-index: 2;
}

.polaroid-right {
    transform: rotate(7deg);
}

.polaroid:hover {
    transform: rotate(0deg) translateY(-8px);
    z-index: 3;
}

@media (max-width: 600px) {
    .photo-gallery {
        gap: 22px 12px;
        padding: 35px 10px;
    }

    .polaroid {
        width: 42%;
        padding: 8px 8px 25px;
    }

    .polaroid-main {
        width: 55%;
    }

    .gallery-caption {
        font-size: 28px;
    }
}