:root {
    --bg-light: #FAFAFA;
    --bg-powder: #F5E6E8;
    --text-main: #2C2A29;
    --text-muted: #595552;
    --burgundy: #722F37;
    --burgundy-light: #8B3A43;
    --burgundy-dark: #521E24;
    --white: #FFFFFF;
    
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    
    --transition-slow: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition-normal: 0.4s ease;
    --transition-fast: 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-slow: 0.01s;
        --transition-normal: 0.01s;
        --transition-fast: 0.01s;
    }
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
.serif-title {
    font-family: var(--font-serif);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--burgundy);
}

.sans-subtitle {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.serif-subtitle {
    font-family: var(--font-serif);
    font-weight: 400;
    font-style: italic;
    font-size: 1.3rem;
    color: var(--white);
    opacity: 0.9;
}

.text-center {
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

/* Layout */
.section {
    padding: 6rem 2rem;
    position: relative;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.bg-light { background-color: var(--bg-light); }
.bg-powder { background-color: var(--bg-powder); }
.bg-dark { background-color: var(--burgundy-dark); color: var(--white); }

/* Buttons */
.btn-primary {
    background-color: transparent;
    color: var(--white);
    border: 1px solid var(--white);
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition-normal);
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

.btn-primary:hover {
    background-color: var(--white);
    color: var(--burgundy);
}

.btn-secondary {
    background-color: transparent;
    color: var(--burgundy);
    border: 1px solid var(--burgundy);
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition-normal);
    border-radius: 4px;
}

.btn-secondary:hover {
    background-color: var(--burgundy);
    color: var(--white);
}

/* Music Button */
.music-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    background-color: rgba(114, 47, 55, 0.9);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
}

/* Login Screen */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-powder);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease;
}

.login-container {
    text-align: center;
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 90%;
}

.login-input {
    width: 100%;
    padding: 1rem;
    margin: 1.5rem 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.login-input:focus {
    border-color: var(--burgundy);
}

.login-error {
    color: #e74c3c;
    margin-top: 1rem;
    font-size: 0.9rem;
}

#login-btn {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 1.2rem;
    margin-top: 10px;
    background-color: var(--burgundy);
    color: var(--white);
    border: none;
    border-radius: 30px;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(114, 47, 55, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(114, 47, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(114, 47, 55, 0); }
}

.music-btn:hover {
    transform: translateY(-2px);
    background-color: var(--burgundy);
}

.music-btn.playing .icon {
    animation: pulse 1.5s infinite alternate;
    display: inline-block;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.3); opacity: 1; }
}

/* 1. Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #2a2a2a; /* Placeholder fallback */
    z-index: 0;
    transform: scale(1.05); /* For slight parallax/animation */
    animation: slowZoom 20s infinite alternate linear;
}

@keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 2rem;
    transform: translateY(-160px);
}

.hero .serif-title {
    color: var(--white);
    font-size: 4rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero .sans-subtitle {
    color: rgba(255,255,255,0.9);
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* 2. Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--burgundy-light);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
    opacity: 0.3;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    margin-bottom: 3rem;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: var(--bg-light);
    border: 3px solid var(--burgundy);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left { left: 0; }
.right { left: 50%; }

.right::after {
    left: -8px;
}

.timeline-content {
    padding: 2rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform var(--transition-normal);
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.timeline-date {
    font-family: var(--font-serif);
    color: var(--burgundy);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.timeline-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-top: 1rem;
    background-color: #eaeaea;
}

@media screen and (max-width: 768px) {
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 0; }
    .timeline-item::after { left: 23px; }
    .right { left: 0%; }
}

/* 3. Reasons (Cards) */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.reason-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(114, 47, 55, 0.05);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.reason-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background-color: var(--burgundy);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
    transform-origin: left;
}

.reason-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(114, 47, 55, 0.1);
}

.reason-card:hover::before, .reason-card.active::before {
    transform: scaleX(1);
}

.reason-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    transition: var(--transition-fast);
}

.reason-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    opacity: 0;
    max-height: 0;
    transition: all var(--transition-normal);
}

.reason-card.active .reason-desc {
    opacity: 1;
    max-height: 100px;
}
.reason-card.active .reason-title {
    color: var(--burgundy);
    margin-bottom: 0.5rem;
}

/* 4. Gallery */
.gallery-scroll {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem 2rem;
    padding: 2rem 1rem;
}

.polaroid {
    flex: 0 0 300px;
    background: var(--white);
    padding: 15px 15px 40px 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease-out;
    position: relative;
}

.polaroid:nth-child(even) { transform: rotate(2deg); }
.polaroid:nth-child(odd) { transform: rotate(-2deg); }

.polaroid:hover {
    transform: scale(1.05) rotate(0deg);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.polaroid img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    background-color: #ddd;
}

.polaroid-caption {
    font-family: 'Playfair Display', cursive, serif;
    font-style: italic;
    text-align: center;
    position: absolute;
    bottom: 12px;
    width: calc(100% - 30px);
    color: var(--text-muted);
}

/* 5. Quiz */
.quiz-box {
    background-color: var(--white);
    border-radius: 16px;
    padding: 3rem;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(114, 47, 55, 0.08);
    text-align: center;
}

.quiz-question {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--burgundy);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-btn {
    background-color: var(--bg-powder);
    border: 1px solid transparent;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-sans);
    color: var(--text-main);
}

.quiz-btn:hover {
    background-color: #efe0e2;
    transform: translateY(-2px);
}

.quiz-btn.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.quiz-btn.wrong {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.quiz-result {
    margin-top: 2rem;
    font-size: 1.2rem;
    display: none;
    animation: fadeIn var(--transition-normal);
}

/* 6. Envelope / Letter */
.letter-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.envelope-container {
    width: 320px;
    height: 200px;
    margin: 4rem auto;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
}

.envelope-hint {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulseHint 2s infinite;
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    background: #e6dac3;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.5s;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 100px solid #d4c8b2;
    z-index: 3;
    transform-origin: top;
    transition: transform 0.8s;
}

.envelope-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 160px solid #dbcbb1;
    border-right: 160px solid #dbcbb1;
    border-bottom: 100px solid #e6dac3;
    border-top: 100px solid transparent;
    z-index: 2;
    pointer-events: none;
}

.envelope-paper {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: var(--white);
    padding: 2rem;
    z-index: 1;
    border-radius: 2px;
    transition: transform 1s, height 1s;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.letter-content {
    opacity: 0;
    transition: opacity 0.5s;
    font-family: var(--font-serif);
    color: var(--text-main);
    line-height: 1.8;
}

/* Envelope Open State */
.envelope-container.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 0;
}

.envelope-container.open .envelope-paper {
    transform: translateY(-150px);
    height: 400px;
    z-index: 4;
    overflow-y: auto;
}

.envelope-container.open .letter-content {
    opacity: 1;
    transition-delay: 0.8s;
}

/* Footer */
.footer {
    padding: 3rem;
    text-align: center;
}

/* Animations & Reveal */
.reveal {
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
}

.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s ease;
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@media screen and (max-width: 600px) {
    .hero .serif-title { font-size: 2.5rem; }
    .section { padding: 4rem 1.5rem; }
    .section-title { font-size: 2rem; }
    .envelope-container { width: 280px; }
    .envelope-flap { border-left-width: 140px; border-right-width: 140px; }
    .envelope-front { border-left-width: 140px; border-right-width: 140px; }
}

/* Floating Hearts */
.floating-heart {
    position: absolute;
    font-size: 2rem;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: floatUp 2s ease-out forwards;
    z-index: 100;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -150px) scale(1.5); }
}

/* Gallery Fly-out Animations */
.fly-out-left {
    transform: translate(-100px, -200px) rotate(-25deg) scale(0.9) !important;
    opacity: 0 !important;
}

.fly-out-right {
    transform: translate(100px, -200px) rotate(25deg) scale(0.9) !important;
    opacity: 0 !important;
}

/* Hero Background Hearts */
@keyframes heroHeartFloat {
    0% { opacity: 0; transform: translateY(0) scale(var(--scale, 1)); }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-100vh) scale(var(--scale, 1)); }
}

.hero-heart {
    position: absolute;
    bottom: -10%;
    z-index: 5;
    animation: heroHeartFloat linear forwards;
    pointer-events: none;
}
