:root {
    --bg-color: #fbf7f2;
    --primary-color: #d4b8a2;
    /* Soft pastel brown/nude */
    --accent-color: #e8c4c4;
    /* Pastel pink */
    --text-color: #5a5550;
    --text-dark: #2c2a27;
    --white: #ffffff;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.03);

    --font-script: 'Great Vibes', cursive;
    --font-sans: 'Inter', sans-serif;

    --spacing-section: 60px;
    --radius-card: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.hidden {
    display: none !important;
}

.container {
    max-width: 600px;
    /* Mobile first constrained width for desktop */
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1,
h2,
h3 {
    color: var(--text-dark);
}

.section-title {
    font-family: var(--font-script);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/* 1. Password Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(251, 247, 242, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px 30px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    text-align: center;
    width: 90%;
    max-width: 350px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-content h1 {
    font-family: var(--font-script);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hint-text {
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="password"] {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-family: inherit;
    outline: none;
    background: #fff;
    transition: border-color 0.3s;
}

input[type="password"]:focus {
    border-color: var(--primary-color);
}

#unlock-btn {
    padding: 0 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s, background 0.3s;
}

#unlock-btn:active {
    transform: scale(0.95);
}

#error-msg {
    color: #d9534f;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* Shake Animation */
.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* 2. Hero Section */
#hero {
    height: 80vh;
    /* Not full screen but tall */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    color: var(--white);
    margin-bottom: var(--spacing-section);
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

#hero-title {
    font-family: var(--font-script);
    font-size: 4rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#hero-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
    letter-spacing: 1px;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    z-index: 2;
    animation: bounce 2s infinite;
    font-size: 1.5rem;
    opacity: 0.8;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* 3. Counter Section */
#counter {
    margin-bottom: var(--spacing-section);
    text-align: center;
}

.timer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.time-box {
    background: var(--white);
    padding: 15px 5px;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-box span:first-child {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Pulse animation for numbers */
.pulse-num {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.time-box .label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    margin-top: 5px;
}

/* 4. Music Section */
#music {
    margin-bottom: var(--spacing-section);
}

.music-card {
    background: var(--white);
    border-radius: 20px;
    /* Pill shapeish */
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

#music-cover {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    animation: spin 10s linear infinite;
    animation-play-state: paused;
}

.music-card.playing #music-cover {
    animation-play-state: running;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.music-info {
    flex: 1;
}

#music-song {
    font-size: 1rem;
    margin-bottom: 2px;
}

#music-artist {
    font-size: 0.8rem;
    color: #888;
}

.play-btn {
    background: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.play-btn:active {
    transform: scale(0.9);
}

.play-btn svg {
    width: 18px;
    height: 18px;
}

/* 5. Vertical Gallery */
#gallery {
    margin-bottom: var(--spacing-section);
}

.vertical-feed {
    display: flex;
    flex-direction: column;
    gap: 40px;
    /* Wide spacing */
}

.feed-card {
    background: var(--white);
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
    /* Fade in animation setup */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.feed-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.media-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 125%;
    /* 4:5 Aspect Ratio for portrait feel */
    background: #f0f0f0;
    overflow: hidden;
}

.feed-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feed-card:hover .feed-media {
    transform: scale(1.03);
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.4);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    padding: 80px 20px 30px;
    color: white;
    opacity: 0;
    /* Hidden by default */
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    /* Center text horizonally */
    pointer-events: none;
    /* Let clicks pass through if needed, though they are inside the anchor/card */
}

/* On mobile, tapping the card triggers :hover state in many browsers, but we can also ensure 
   better visibility or layout for touch */
@media (hover: none) {
    .card-overlay {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
    }
}

.feed-card:hover .card-overlay {
    opacity: 1;
    transform: translateY(0);
}

.feed-card:hover .tap-indicator {
    opacity: 0;
    /* Hide the 'tap' button when overlay is visible */
    transform: scale(0.9);
}

.card-date {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card-caption {
    font-weight: 700;
    font-size: 1.1rem;
    /* Slightly smaller for better fit on mobile if lengthy */
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: var(--font-sans);
    padding: 0 10px;
    /* Add padding for text block */
}

/* Tap Indicator (Button) */
.tap-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    z-index: 5;
    pointer-events: none;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tap-indicator svg {
    width: 14px;
    height: 14px;
}

/* 6. Location Section */
#location {
    margin-bottom: var(--spacing-section);
}

.location-card {
    background: var(--white);
    padding: 30px 20px;
    border-radius: var(--radius-card);
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.loc-desc-text {
    margin-bottom: 20px;
    color: #666;
}

.loc-image-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 25px;
}

#loc-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.loc-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.primary-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(212, 184, 162, 0.4);
    transition: transform 0.2s;
}

.primary-btn:active {
    transform: scale(0.96);
}

/* 7. Letter Section */
#letter {
    margin-bottom: 80px;
}

.paper {
    background: #fffdf9;
    padding: 40px;
    box-shadow: var(--shadow-soft);
    border-radius: 4px;
    /* More square like paper */
    position: relative;
    /* Basic paper lines effect */
    background-image: linear-gradient(#eee 1px, transparent 1px);
    background-size: 100% 30px;
    line-height: 30px;
}

.handwritten-title {
    font-family: var(--font-script);
    color: var(--accent-color);
    font-size: 2.2rem;
    margin-bottom: 20px;
    text-align: center;
}

.letter-body {
    font-family: 'Inter', sans-serif;
    /* Readable */
    color: #555;
    white-space: pre-wrap;
    /* Align with lines */
    margin-top: 5px;
}

/* 8. Footer */
#footer {
    text-align: center;
    padding-bottom: 40px;
    color: #999;
    font-size: 0.8rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content-wrapper {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

/* Animations Trigger Class */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Love Check Section */
#love-check {
    text-align: center;
    margin-bottom: 60px;
    padding: 20px;
}

#love-text {
    font-family: var(--font-script);
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.heart-btn {
    background: var(--accent-color);
    /* Pastel pink */
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(232, 196, 196, 0.6);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-sans);
    font-weight: 600;
}

.heart-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(232, 196, 196, 0.4);
}

/* Floating Hearts Container */
#hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    bottom: -50px;
    font-size: 2rem;
    animation: floatUp 3s ease-in forwards;
    opacity: 0.8;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}