:root {
  /* --- Color Palette --- */
  --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  --blob-color-1: rgba(255, 192, 203, 0.6); /* Soft Pink */
  --blob-color-2: rgba(173, 216, 230, 0.6); /* Soft Blue */
  
  /* --- Glass Settings --- */
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: 1px solid rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --blur: blur(8px);
  
  /* --- Spacing --- */
  --gap: 20px;
}

/* --- Base Body & Background --- */
body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: #f0f4f8; /* Fallback */
  
  /* Animated Blobs Background */
  background-image: 
    radial-gradient(at 0% 0%, var(--blob-color-1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, var(--blob-color-2) 0px, transparent 50%),
    radial-gradient(at 100% 100%, var(--blob-color-1) 0px, transparent 50%),
    radial-gradient(at 0% 100%, var(--blob-color-2) 0px, transparent 50%);
  background-attachment: fixed;
  background-size: cover;
  
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}

/* --- Typography --- */
h1 {
  text-align: center;
  color: #555;
  font-weight: 300;
  margin-bottom: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 2rem;
  opacity: 0.8;
}

/* --- MAIN CONTAINER LAYOUT --- */
/* This holds the two zones (Zone 1 & Zone 2) */
.bento-container {
    display: grid;
    /* DEFAULT (Mobile): 1 column, stacked vertically */
    grid-template-columns: 1fr; 
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 80px; /* Space for footer */
}

/* Desktop/Laptop View (Landscape) */
@media (min-width: 1024px) {
    .bento-container {
        /* Switch to side-by-side view */
        grid-template-columns: 1fr 1fr;
        align-items: center; /* Center vertically */
        height: 95vh; /* Take up most of screen */
    }
}

/* --- MEMORY ZONE LAYOUT (The Single Card Pair) --- */
/* Each zone contains one Text card + one Image card */
.memory-zone {
    display: flex; /* We use flexbox for the 1:3 ratios */
    width: 100%;
    height: 450px; /* Fixed height to allow cropping */
    
    background: rgba(255, 255, 255, 0.15);
    border: var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    
    overflow: hidden;
    position: relative;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Entry Animation */
    opacity: 0; 
    animation: fadeIn 0.8s forwards;
}

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

/* --- INNER CARDS (Text & Image) --- */
.glass-card {
    /* Reset generic styles */
    position: relative;
    overflow: hidden;
    transition: flex 0.5s ease; /* Smooth transition when ratio changes */
}

/* Text Card Specifics */
.text-card {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.4); /* Slightly more opaque for readability */
    color: #444;
}

.text-card p {
    font-size: 1.25rem;
    line-height: 1.5;
    text-align: center;
    margin: 0;
    font-weight: 500;
}

/* Image Card Specifics */
.image-card {
    /* No background needed, image covers it */
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;    /* Ensures image covers the area without stretch */
    object-position: center 40%; /* KEEPS FACES SAFE: Crops from bottom only */
    display: block;
    transition: transform 5s ease; /* Subtle zoom effect */
}

/* Hover Effect: Slight Zoom on Image */
.memory-zone:hover .image-card img {
    transform: scale(1.05);
}


/* --- LAYOUT VARIATIONS (Applied by JS) --- */

/* 1. VERTICAL STACK (Top/Bottom) */
/* Triggered randomly or on mobile */
.layout-vertical {
    flex-direction: column;
}
.layout-vertical .text-card { flex: 1; }  /* Takes 1 part */
.layout-vertical .image-card { flex: 3; } /* Takes 3 parts (The 1:3 Ratio) */


/* 2. HORIZONTAL ROW (Side-by-Side) */
/* Triggered randomly on desktop */
.layout-horizontal {
    flex-direction: row;
}

/* Horizontal Ratio A: Wide Image (1:2) */
.ratio-wide-img.layout-horizontal .text-card { flex: 1; }
.ratio-wide-img.layout-horizontal .image-card { flex: 2; }

/* Horizontal Ratio B: Equal (1:1) */
.ratio-equal.layout-horizontal .text-card { flex: 1; }
.ratio-equal.layout-horizontal .image-card { flex: 1; }


/* --- ORDERING (Randomness) --- */
/* Swaps Text/Image positions without changing HTML */
.order-normal .text-card { order: 1; }
.order-normal .image-card { order: 2; }

.order-reverse .text-card { order: 2; }
.order-reverse .image-card { order: 1; }


/* --- FOOTER --- */
.anniversary-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #666;
    border-top: 1px solid rgba(255,255,255,0.5);
    z-index: 100;
}

/* --- MOBILE OVERRIDES --- */
@media (max-width: 768px) {
    /* Force vertical stack on phones regardless of JS choice */
    .memory-zone {
        flex-direction: column !important;
        height: 500px; /* Taller on mobile to show more image */
    }
    
    /* Force 1:3 Ratio on mobile */
    .text-card { 
        flex: 1 !important; 
        order: 2 !important; /* Text always below image on mobile for consistency */
    }
    
    .image-card { 
        flex: 3 !important; 
        order: 1 !important; /* Image always on top */
    }
    
    .bento-container {
        padding-bottom: 60px;
    }
}