/*
 * =========================================================================================
 *  DREAMY CLOUD - MAIN STYLESHEET (LIVING EXCEPTION)
 * =========================================================================================
 */

/* --- 1. VARIABLES & RESET --- */
:root {
    --primary: #ffdae0;
    --secondary: #e0f2fe;
    --text-color: #4a4a4a;
    --highlight: #ff7eb3;

    --font-heading: 'Dancing Script', cursive;
    --font-body: 'Nunito', sans-serif;

    --spacing-md: 32px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: var(--font-body);
    color: var(--text-color);
    scroll-behavior: smooth;
    background: radial-gradient(circle at 50% 50%, #fffbf0 0%, #ffe4e6 50%, #e0f2fe 100%);
    background-size: 200% 200%;
    animation: meshFlow 20s ease infinite alternate;
}

@keyframes meshFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

h1,
h2,
h3,
h4,
.handwritten {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

/* --- 2. LIVING SKY BACKGROUND --- */
#sky-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: #fff;
    border-radius: 100px;
    opacity: 0.8;
    filter: blur(8px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    animation: drift linear infinite;
}

.cloud::after,
.cloud::before {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud::after {
    width: 50px;
    height: 50px;
    top: -30px;
    left: 15px;
}

.cloud::before {
    width: 70px;
    height: 70px;
    top: -40px;
    left: 40px;
}

@keyframes drift {
    from {
        transform: translateX(-200px);
    }

    to {
        transform: translateX(100vw);
    }
}

.particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px var(--highlight);
    animation: floatUp linear infinite, twinkle ease-in-out infinite alternate;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(110vh) translateX(0);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    80% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-10vh) translateX(20px);
        opacity: 0;
    }
}

@keyframes twinkle {
    0% {
        transform: scale(0.8);
    }

    100% {
        transform: scale(1.2);
    }
}

/* --- 3. UTILITIES & GLASSMORPHISM --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md) 0;
}

.glass-card {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* --- 4. SPLASH SCREEN --- */
#splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 1.5s ease, visibility 1.5s;
}

#splash-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.heart-icon {
    font-size: 5rem;
    animation: pulse 1.5s infinite;
    cursor: pointer;
    color: var(--highlight);
    filter: drop-shadow(0 0 15px rgba(255, 126, 179, 0.6));
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.enter-text {
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-color);
    opacity: 0.7;
    animation: fadeIn 2s infinite alternate;
}

/* --- 5. HERO SECTION --- */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color);
    padding-top: 60px;
    overflow: hidden;
}

/* New Banner/Hero Background */
#hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Behind text */
    background-position: center;
    background-size: cover;
    opacity: 0.6;
    /* Fade it so text reads well */
    /* Add a nice fade-out at bottom to blend with sky */
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 90%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 90%);
    transition: opacity 1s ease;
}

.hero-content {
    z-index: 2;
    padding: 40px;
    border-radius: 30px;
    /* Optional: Slight box behind text for better read */
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.hero-content h1 {
    font-size: 5rem;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    color: var(--highlight);
}

.hero-content p {
    font-size: 1.5rem;
    font-family: var(--font-body);
    font-weight: 300;
    background: linear-gradient(90deg, #444, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #666;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* --- 6. SECTIONS --- */
section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 40px;
    color: var(--highlight);
    text-shadow: 0 4px 10px rgba(255, 255, 255, 0.7);
}

/* Counter */
#timer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--highlight);
    text-shadow: 2px 2px 0px white;
}

.label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    margin-top: 5px;
}

/* NEW: MUSIC SECTION (INLINE) */
.music-wrapper {
    display: flex;
    justify-content: center;
}

.music-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    width: 100%;
}

@media(min-width: 768px) {
    .music-card {
        flex-direction: row;
        text-align: left;
    }

    .music-info {
        align-items: flex-start !important;
        text-align: left !important;
    }
}

.vinyl-large {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: #111;
    background-size: cover;
    background-position: center;
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: spin 6s linear infinite paused;
    flex-shrink: 0;
}

.vinyl-large.playing {
    animation-play-state: running;
}

.music-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
}

.music-title-large {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--highlight);
    margin-bottom: 5px;
    line-height: 1.2;
}

.music-artist-large {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.play-btn-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    color: var(--highlight);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-btn-large:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.music-visualizer {
    display: flex;
    gap: 5px;
    height: 30px;
    align-items: flex-end;
    margin-top: 20px;
}

.bar {
    width: 6px;
    background: white;
    opacity: 0.6;
    border-radius: 3px;
    animation: bounce 0.5s infinite alternate paused;
}

.music-card.playing .bar {
    animation-play-state: running;
}

@keyframes bounce {
    0% {
        height: 5px;
    }

    100% {
        height: 100%;
    }
}

.bar:nth-child(1) {
    height: 10px;
    animation-duration: 0.6s;
}

.bar:nth-child(2) {
    height: 20px;
    animation-duration: 0.4s;
}

.bar:nth-child(3) {
    height: 15px;
    animation-duration: 0.7s;
}

.bar:nth-child(4) {
    height: 25px;
    animation-duration: 0.5s;
}

.bar:nth-child(5) {
    height: 12px;
    animation-duration: 0.6s;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Gallery */
.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 10px 25px;
    border: 2px solid white;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: white;
    color: var(--highlight);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.gallery-grid {
    display: grid;
    /* Increased min size for larger photos */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    padding: 10px;
}

.gallery-grid.hidden {
    display: none;
}

.polaroid {
    background: white;
    padding: 15px 15px 60px 15px;
    /* More space */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.polaroid:hover {
    transform: scale(1.1) rotate(0deg) !important;
    z-index: 50;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.polaroid img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    filter: contrast(0.9) brightness(1.1);
}

.caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: var(--font-heading);
    color: #444;
    font-size: 1.6rem;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background: rgba(255, 255, 255, 0.8);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
}

.timeline-content {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.timeline-date {
    color: var(--highlight);
    font-weight: 800;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--highlight);
    border: 4px solid white;
    border-radius: 50%;
    top: 20px;
    z-index: 1;
}

.timeline-item.left::after {
    right: -12px;
}

.timeline-item.right::after {
    left: -12px;
}

/* Letter Section Centering Fix */
.centered-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    width: 100%;
}

.envelope-wrapper {
    margin: 60px auto 120px auto;
    position: relative;
}

.envelope-icon {
    font-size: 8rem;
    cursor: pointer;
    transition: transform 0.3s;
    display: inline-block;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.1));
}

.envelope-icon:hover {
    transform: translateY(-10px);
}

.open-letter-btn {
    background: white;
    padding: 12px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    color: var(--highlight);
    margin-top: 10px;
    transition: transform 0.2s;
}

.open-letter-btn:active {
    transform: scale(0.95);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
    padding: 20px;
    z-index: 5000;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #fffdf9 url('https://www.transparenttextures.com/patterns/cream-paper.png');
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 40px;
    border-radius: 5px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    line-height: 1.5;
    transform: perspective(1000px) rotateX(10deg);
    transition: transform 0.4s;
}

.modal.active .modal-content {
    transform: perspective(1000px) rotateX(0deg);
}

.close-btn {
    position: sticky;
    top: 0;
    float: right;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
    background: none;
    border: none;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .timeline::after {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 50px;
        text-align: left !important;
    }

    .timeline-item.left,
    .timeline-item.right {
        left: 0;
    }

    .timeline-item::after {
        left: 12px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}