/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #4b5563;

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    background-color: #f0f8ff;
    /* Fallback color */
    position: relative;
}

/* 
   Mobile Fix: Moving animation to a fixed element prevents 
   repaint issues during scroll on iOS/Safari.
*/
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;

    /* Traditional Sky & Clouds Gradient: Sky Blue, Cloud White, Azure */
    background: linear-gradient(-45deg, #89CFF0, #F0F8FF, #B0E0E6, #00BFFF);
    background-size: 400% 400%;

    -webkit-animation: gradientBG 15s ease infinite;
    animation: gradientBG 15s ease infinite;
    will-change: background-position;

    /* Hardware acceleration hack */
    transform: translateZ(0);
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@-webkit-keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header / Hero */
header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    animation: fadeInDown 1.2s ease-out;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: inline-block;
    background: rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(5px);
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
    color: #111827;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

/* Glassmorphism Cards (Letter & Grid) */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

/* Letter Section */
.letter-section {
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 1.2s ease-out 0.2s backwards;
}

.letter-content p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.letter-content strong {
    color: #000;
    font-weight: 700;
}

/* Gratitude Grid */
.gratitude-grid {
    display: grid;
    /* Strictly 3 columns on desktop to fix alignment */
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 1.2s ease-out 0.4s backwards;
}

.card {
    padding: var(--spacing-md);
    transition: transform 0.3s ease, background 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.85);
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: #000;
}

.card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Footer */
footer {
    margin-top: auto;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeIn 2s ease-out 0.8s backwards;
}

/* Utilities */
.divider {
    display: none;
    /* Removed divider for cleaner look */
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .gratitude-grid {
        /* Switch to vertical stack on mobile/tablet */
        grid-template-columns: 1fr;
    }

    .letter-section {
        padding: var(--spacing-md);
    }

    .container {
        padding: var(--spacing-md);
    }

    /* Mobile Animation Speedup for visibility */
    .bg-animation {
        -webkit-animation-duration: 7s;
        animation-duration: 7s;
    }
}