:root {
    --bg: #fdfcf9;
    --ink: #1a1a1a;
    --gold: #b2935b;
    --line-height: 2.3; 
    --luxury-gap: 15vh;
    --transition: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- CORE RESET --- */
html, body { 
    width: 100%; 
    max-width: 100vw;
    overflow-x: hidden; 
    margin: 0; 
    padding: 0; 
    background-color: var(--bg);
    -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    color: var(--ink); 
    font-family: 'Spectral', serif; 
    line-height: var(--line-height); 
    -webkit-font-smoothing: antialiased;
}

::selection { background-color: rgba(178, 147, 91, 0.2); color: var(--ink); }
::-webkit-selection { background-color: rgba(178, 147, 91, 0.2); color: var(--ink); }

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

#preloader.hidden { opacity: 0; visibility: hidden; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 25px; }

/* --- HERO --- */
.hero {
    height: 100vh;
    min-height: -webkit-fill-available; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.recipient {
    font-family: 'Cinzel', serif;
    font-size: clamp(0.65rem, 2.5vw, 0.85rem);
    letter-spacing: clamp(4px, 1.5vw, 10px);
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 25px;
    white-space: nowrap; 
    opacity: 0;
    animation: revealUp 1.4s var(--transition) forwards 0.5s;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.2rem, 6vw, 2.6rem);
    font-weight: 400;
    letter-spacing: clamp(1px, 0.5vw, 4px);
    color: var(--ink);
    margin-bottom: 15px;
    white-space: nowrap; 
    opacity: 0;
    animation: revealUp 1.4s var(--transition) forwards 0.8s;
}

.hero-sub {
    font-style: italic;
    font-size: clamp(0.85rem, 3.5vw, 1.15rem);
    opacity: 0;
    font-weight: 300;
    animation: revealUp 1.4s var(--transition) forwards 1.1s;
}

@keyframes revealUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- SCROLL INDICATOR --- */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0; 
    animation: fadeIn 1s ease forwards 2s; 
}

.scroll-text {
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
}

.scroll-line {
    width: 1px;
    height: 45px;
    background: linear-gradient(to bottom, var(--gold), transparent);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, var(--gold), transparent);
    animation: flow 2s infinite;
}

@keyframes flow {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}
@keyframes fadeIn { to { opacity: 1; } }

/* --- MAIN VIEW POSTCARD --- */
.card-view {
    perspective: 2000px;
    margin: var(--luxury-gap) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.postcard {
    width: 100%;
    max-width: 820px;
    aspect-ratio: 1365 / 768;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.2s var(--transition);
    box-shadow: 0 40px 80px rgba(0,0,0,0.06);
    user-select: none;
    -webkit-user-drag: none;
}

.postcard.flipped { transform: rotateY(180deg); }

.face {
    position: absolute;
    width: 100%; height: 100%;
    backface-visibility: hidden;
    background: #fff;
    border-radius: 2px;
    overflow: hidden;
}

.face img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.back { transform: rotateY(180deg); }

.btn-expand {
    margin-top: 35px;
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    cursor: pointer;
    padding: 10px 20px;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

.btn-expand:hover { border-bottom-color: var(--gold); }
.btn-expand:active { opacity: 0.6; }

/* --- LIGHTBOX (READ MODE) --- */
.lightbox {
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: var(--bg);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    touch-action: none; 
}

.lightbox.active { display: flex; }

.lightbox-card {
    width: 90vw;
    max-width: 1100px;
    aspect-ratio: 1365 / 768;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s var(--transition);
    cursor: pointer; 
}

.lightbox-card.flipped { transform: rotateY(180deg); }

@media (max-width: 768px) {
    .lightbox-card { width: 65vh; transform: rotate(90deg); }
    .lightbox-card.flipped { transform: rotate(90deg) rotateY(180deg); }
}

.close-btn {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--ink);
    background: rgba(253, 252, 249, 0.9);
    backdrop-filter: blur(5px);
    padding: 12px 28px;
    border-radius: 50px;
    border: 1px solid var(--gold);
    z-index: 10001;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.close-btn:active { transform: translateX(-50%) scale(0.95); }

/* --- ACTIONS & STORY --- */
.actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: var(--luxury-gap);
}

.btn-save {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-decoration: none;
    color: var(--ink);
    padding-bottom: 5px;
    border-bottom: 1px solid var(--gold);
    cursor: pointer;
}

.story { max-width: 650px; margin: 0 auto; }

.block {
    margin-bottom: 150px;
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s var(--transition);
}

.block.visible { opacity: 1; transform: translateY(0); }

h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 35px;
    color: var(--gold);
    white-space: nowrap; 
}

p {
    font-size: clamp(1.1rem, 3.5vw, 1.25rem);
    text-align: justify;
    font-weight: 300;
}

/* --- FOOTER --- */
footer {
    padding: 120px 0 60px;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center; 
    width: 100%;
    overflow: hidden;
}

.signature {
    font-family: 'Cinzel', serif;
    font-size: clamp(0.6rem, 3.5vw, 0.8rem);
    letter-spacing: clamp(1px, 1.2vw, 6px);
    text-transform: uppercase;
    margin-bottom: 25px;
    white-space: nowrap; 
    text-align: center;
    width: 100%;
    display: block;
}

.disclaimer {
    font-size: 0.65rem;
    max-width: 450px;
    margin: 0 auto;
    opacity: 0.3;
    line-height: 1.8;
    font-style: italic;
    text-align: center;
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .hero { height: 85vh; }
    .actions { flex-direction: column; align-items: center; gap: 20px; }
    p { text-align: left; line-height: 2.2; }
    .block { margin-bottom: 100px; }
}

/* --- REFINED MUSIC CONTROL --- */
.music-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: rgba(253, 252, 249, 0.8);
    padding: 10px 20px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid var(--gold);
    transition: all 0.3s var(--transition);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.music-control:hover { 
    transform: translateY(-3px); 
    background: rgba(253, 252, 249, 1);
}

.music-text { 
    font-family: 'Cinzel', serif; 
    font-size: 0.6rem; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    color: var(--ink); 
}

.music-icon { color: var(--gold); font-size: 1rem; }

@media (max-width: 768px) {
    .music-control { right: 20px; bottom: 20px; padding: 8px 16px; }
}