/* ==========================================================================
   Stop Killing Myths – Fixed Polaroid System
   ========================================================================== */

/* ROOT & DESIGN TOKENS */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --danger: #dc2626;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.95);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    --border: rgba(255, 255, 255, 0.2);
    --shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius: 16px;
    --radius-lg: 24px;
}

/* RESET & BASE */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e1b4b 100%);
    color: var(--text-white);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 198, 255, 0.3) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: -2;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(0.5deg); }
    66% { transform: translateY(-10px) rotate(-0.5deg); }
}

/* LOGO & BANNER PLACEHOLDERS */
.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-white);
    text-decoration: none;
    letter-spacing: -0.05em;
    transition: all 0.3s ease;
}

.logo-image {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.logo-fallback {
    display: none;
}

.banner-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.hero-banner {
    margin-bottom: 2rem;
}

/* NAVIGATION */
.nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-white);
}

.brand-sub {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.025em;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* HEADER / HERO */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.header-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-white) 0%, #e2e8f0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.25rem;
    font-weight: 400;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* COUNTDOWN */
.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-width: 500px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(239, 68, 68, 0.15) 100%);
    border: 2px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(15px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.countdown:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(239, 68, 68, 0.2) 100%);
    border-color: rgba(220, 38, 38, 0.5);
}

.countdown.critical {
    animation: urgentPulse 2s infinite;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.25) 0%, rgba(239, 68, 68, 0.25) 100%);
    border-color: var(--danger);
}

@keyframes urgentPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 40px rgba(220, 38, 38, 0.5);
    }
}

.countdown-item {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: var(--radius);
    padding: 1rem 0.75rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.countdown-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.4);
}

.countdown-number {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    color: #ff6b6b;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.countdown-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.deadline-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(220, 38, 38, 0.15);
    border: 2px solid rgba(220, 38, 38, 0.4);
    border-radius: var(--radius);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* POLAROID SYSTEM - FIXED */
#polaroid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* FIXED: Single source of truth for polaroid visibility */
.polaroid-figure {
    --polaroid-w: 320px;
    --polaroid-h: 260px;
    width: var(--polaroid-w);
    padding: 18px 18px 75px 18px;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    position: fixed;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    will-change: transform, opacity, filter;
    outline: none;
    opacity: 0;
    pointer-events: auto;
    z-index: 1;
    display: none;
    user-select: none; /* Prevent text selection that might interfere with clicks */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.polaroid-figure * {
    pointer-events: none; /* Children don't intercept clicks - let parent handle all clicks */
}

/* FIXED: Only show in memory mode */
.memory-mode .polaroid-figure {
    display: block;
    animation: fadeInPolaroid 0.8s ease forwards;
}

@keyframes fadeInPolaroid {
    to { opacity: 0.85; }
}

.polaroid-caption {
    line-height: 1.2;
    word-wrap: break-word;
    hyphens: auto;
}

.polaroid-caption {
    position: absolute;
    bottom: 35px; /* Positioned from bottom with enough space for secret text */
    left: 0;
    right: 0;
    max-height: 40px; /* Limit height to prevent extending into image */
    text-align: center;
    font: 500 14px/1.2 'Courier New', monospace;
    color: #222;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    max-width: calc(100% - 16px);
    margin: 0 8px;
    
    /* Allow text to wrap naturally */
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
    
    /* Limit to 2-3 lines and handle overflow */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Max 2 lines to fit in space */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    
    /* Better line spacing */
    line-height: 1.2;
}


.polaroid-figure:hover {
    transform: scale(1.08) rotate(0deg) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 5;
}

.polaroid-figure:hover:not(.expanded) {
    transform: scale(1.05) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 5000; /* Higher than normal but lower than expanded */
}

.polaroid-figure.expanded {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(2.0) !important;
    z-index: 99999 !important;
    animation: none !important;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1 !important;
    cursor: default; /* Don't show pointer cursor when expanded */
}

.polaroid-figure.blurred {
    filter: blur(1.5px);
    opacity: 0.4;
    pointer-events: none;
}

.polaroid-figure.faded {
    opacity: 0.3;
    pointer-events: none;
}

.polaroid-figure.expanded .polaroid-photo {
    height: calc(var(--polaroid-h) * 1.3);
}

/* Size variations */
.polaroid-size-small {
    --polaroid-w: 240px;
    --polaroid-h: 200px;
    padding-bottom: 50px;
}
.polaroid-size-small .polaroid-caption {
    font-size: 12px;
    bottom: 28px; /* More space from bottom for small polaroids */
    max-height: 32px;
    -webkit-line-clamp: 2;
    line-clamp :2;
    line-height: 1.1;
}

.polaroid-size-small .polaroid-secret {
    font-size: 10px;
    bottom: 12px;
}


.polaroid-size-large {
    --polaroid-w: 400px;
    --polaroid-h: 340px;
    padding-bottom: 70px;
}


.polaroid-size-large .polaroid-caption {
    font-size: 16px;
    bottom: 45px; /* More space from bottom for large polaroids */
    max-height: 50px;
    -webkit-line-clamp: 3;
    line-clamp: 3; /* Allow 3 lines for large polaroids */
    line-height: 1.2;
}

.polaroid-size-large .polaroid-secret {
    font-size: 12px;
    bottom: 18px;
}



.polaroid-photo {
    width: 100%;
    height: var(--polaroid-h);
    background: #f8f8f8;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    pointer-events: none; /* Let parent handle clicks */
}


.polaroid-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Removed heavy filters that reduce image quality */
    filter: sepia(0.05) contrast(1.02) saturate(1.1);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    /* Enhanced image rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: optimizeQuality;
    /* Anti-aliasing for better quality */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}


/* Vintage tints */
.polaroid-vintage-1 { filter: sepia(0.1) hue-rotate(2deg); }
.polaroid-vintage-2 { filter: sepia(0.12) hue-rotate(-2deg) brightness(1.02); }
.polaroid-vintage-3 { filter: sepia(0.15) saturate(1.05); }

.polaroid-figure.expanded .polaroid-photo img {
    filter: sepia(0.02) contrast(1.01) saturate(1.05);
    image-rendering: high-quality;
    image-rendering: -webkit-optimize-contrast;
}

.polaroid-figure *,
.polaroid-figure .polaroid-photo,
.polaroid-figure .polaroid-photo img,
.polaroid-figure .polaroid-caption,
.polaroid-figure .polaroid-secret {
    pointer-events: none !important;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.polaroid-figure.expanded {
    cursor: pointer !important;
}

.polaroid-figure::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: auto;
    cursor: inherit;
}

/* FIXED: Secret text - cleaner implementation */
.polaroid-secret {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    text-align: center;
    font: 400 10px/1.2 'Courier New', monospace;
    opacity: 0;
    color: #444;
    transition: all 0.3s ease;
    pointer-events: none;
    padding: 2px 8px;
    border-radius: 8px;
    max-width: calc(100% - 16px);
    margin: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent;
    text-shadow: 
    1px 1px 0 rgba(255, 255, 255, 0.8),
    -1px -1px 0 rgba(255, 255, 255, 0.8),
    1px -1px 0 rgba(255, 255, 255, 0.8)
    -1px 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(0, 0, 0, 0.1); /* Strong white text outline for contrast */
}

.polaroid-figure.moving {
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.polaroid-figure.restoring {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}


/* Only show secret text when expanded */
.polaroid-figure.expanded .polaroid-secret {
    opacity: 0.9;
    color: #333;
    background: transparent;
    text-shadow: 
    2px 2px 0 rgba(255, 255, 255, 0.9),
    -2px -2px 0 rgba(255, 255, 255, 0.9),
    2px -2px 0 rgba(255, 255, 255, 0.9),
    -2px 2px 0 rgba(255, 255, 255, 0.9),
    0 2px 4px rgba(0, 0, 0, 0.2); /* Even stronger outline when expanded */
}

.polaroid-figure:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 8px;
    z-index: 5001 !important;
}

.polaroid-figure:focus-visible,
.polaroid-figure:focus {
    outline: 3px solid var(--primary);
    outline-offset: 6px; /* Increased offset so it doesn't interfere with clicks */
    transform: scale(1.05) !important;
    z-index: 100 !important;
}

/* Backdrop */
.polaroid-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75); /* Slightly darker for better contrast */
    backdrop-filter: blur(8px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    cursor: pointer; /* Make it clear the backdrop is clickable */
}

.polaroid-backdrop.show {
    opacity: 1;
    visibility: visible;
    display: block;
}

/* Memory Mode Styles */
.memory-mode .nav,
.memory-mode .main,
.memory-mode .footer {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s ease-in-out;
}

.memory-mode {
    background: linear-gradient(135deg, 
        #2c1810 0%, 
        #3d2817 50%, 
        #4a3220 100%) !important;
    transition: all 1.2s ease-in-out !important;
    overflow: hidden;
}

.memory-mode #polaroid-bg {
    z-index: 2;
}

/* Particle System */
.particle {
    position: fixed;
    pointer-events: none;
    font-size: 20px;
    animation: float-up 2s ease-out forwards;
    z-index: 9998;
}

@keyframes float-up {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-100px) scale(0.5); }
}

/* Exit Memory Mode Button */
.exit-memory-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 18px;
    width: 48px;
    height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.exit-memory-mode:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.memory-mode .exit-memory-mode {
    display: flex;
    opacity: 1;
}

/* Smooth exit transitions */
body:not(.memory-mode) .nav,
body:not(.memory-mode) .main,
body:not(.memory-mode) .footer {
    transition: opacity 0.8s ease-in-out;
}

/* Shuffle Button */
.shuffle-polaroids {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    width: 56px;
    height: 56px;
    display: none; /* Hidden by default on home page */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.shuffle-polaroids:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    background: var(--primary-dark);
}

/* Show shuffle button ONLY in memory mode */
.memory-mode .shuffle-polaroids {
    display: flex;
}

.memory-mode .shuffle-polaroids {
    display: none;
}

/* Focus Mode */
.focus-mode .nav,
.focus-mode .main > .container > .content-grid,
.focus-mode .footer {
    opacity: 0.3;
    transition: opacity 0.8s ease;
}

.focus-mode .countdown {
    opacity: 1 !important;
}

/* Drift Animation */
@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(var(--driftX), calc(var(--driftY) * 0.5)); }
    50% { transform: translate(calc(var(--driftX) * 0.7), var(--driftY)); }
    75% { transform: translate(calc(var(--driftX) * -0.3), calc(var(--driftY) * 0.8)); }
}

/* MAIN CONTENT */
.main {
    padding: 3rem 0;
    position: relative;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: start;
}

.card {
    position: relative;
    z-index: 10;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 2rem;
    text-align: center;
    position: relative;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.card-body {
    padding: 2.5rem;
    color: var(--text-primary);
}

/* FORMS */
.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: var(--error);
    animation: shake 0.5s ease-in-out;
}

.form-input.success {
    border-color: var(--success);
}

.form-help {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 56px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--text-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ALERTS */
.alert {
    padding: 1.25rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border-left: 4px solid;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background: rgba(254, 242, 242, 0.95);
    color: #991b1b;
    border-left-color: var(--error);
}

.alert-success {
    background: rgba(236, 253, 245, 0.95);
    color: #065f46;
    border-left-color: var(--success);
}

.alert-warning {
    background: rgba(255, 251, 235, 0.95);
    color: #92400e;
    border-left-color: var(--warning);
}

/* RESOURCE LINKS */
.resource-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.resource-link {
    display: block;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.3s ease;
}

.resource-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
    border-color: var(--primary);
}

.resource-link-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.resource-link-title {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.resource-link-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.resource-link-icon {
    color: var(--primary);
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.resource-link:hover .resource-link-icon {
    transform: translateX(5px);
}

/* INFO SECTIONS */
.info h3 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.action-list {
    list-style: none;
    padding: 0;
}

.action-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-list li:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.1);
}

.action-list .icon {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.info-highlight {
    background: rgba(102, 126, 234, 0.1);
    padding: 1.25rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* SOCIAL LINKS */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-white);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-link:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

.card-section {
    margin-bottom: 2rem;
}

.card-section-title {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

/* CREDITS SECTION */
.core-contributors h4,
.contributors-carousel h4 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.core-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.core-contributor {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(102, 126, 234, 0.25);
}

.core-contributor:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 25px 50px rgba(102, 126, 234, 0.4);
}

.core-role {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.core-name {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.core-name a {
    color: inherit;
    text-decoration: none;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 0;
    margin: 0 -2.5rem;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%);
    border-radius: var(--radius);
}

.carousel-track {
    display: flex;
    gap: 2rem;
    animation: scrollLeftToRight 90s linear infinite;
    width: max-content;
}

.carousel-container:hover .carousel-track {
    animation-play-state: paused;
}

.carousel-item {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    min-width: 220px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.carousel-item:hover {
    transform: translateY(-6px) scale(1.03);
    background: rgba(102, 126, 234, 0.18);
    border-color: rgba(102, 126, 234, 0.4);
}

.carousel-role {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.carousel-name {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes scrollLeftToRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.credits-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    text-align: center;
}

/* FOOTER */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-online {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

.particle {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    font-size: 12px;
    user-select: none;
}

.particle-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #4ecdc4 100%);
    box-shadow: 0 0 6px rgba(78, 205, 196, 0.8);
}

.particle-sparkle {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    font-weight: bold;
}

.particle-ring {
    width: 8px;
    height: 8px;
    border: 2px solid #ff6b6b;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(-10px) scale(1) rotate(36deg);
    }
    100% {
        transform: translateY(-60px) scale(0.3) rotate(360deg);
        opacity: 0;
    }
}

@keyframes float-diagonal {
    0% {
        transform: translate(0, 0) scale(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translate(5px, -15px) scale(1) rotate(45deg);
    }
    100% {
        transform: translate(40px, -80px) scale(0.2) rotate(180deg);
        opacity: 0;
    }
}

@keyframes float-arc {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translate(-10px, -20px) scale(1);
    }
    50% {
        transform: translate(-30px, -50px) scale(1.2);
    }
    100% {
        transform: translate(-20px, -90px) scale(0);
        opacity: 0;
    }
}

.anim-up {
    animation: float-up 1.8s ease-out forwards;
}

.anim-diagonal {
    animation: float-diagonal 2.2s ease-out forwards;
}

.anim-arc {
    animation: float-arc 2s ease-in-out forwards;
}


@keyframes polaroidPushAway {
    0% {
        transform: rotate(var(--original-rotation, 0deg)) scale(1);
        opacity: 0.85;
        filter: blur(0px);
    }
    100% {
        transform: rotate(var(--original-rotation, 0deg)) translate(var(--push-x, 0px), var(--push-y, 0px)) scale(0.9);
        opacity: 0.4;
        filter: blur(1px);
    }
}

@keyframes polaroidReturn {
    0% {
        transform: rotate(var(--original-rotation, 0deg)) translate(var(--push-x, 0px), var(--push-y, 0px)) scale(0.9);
        opacity: 0.4;
        filter: blur(1px);
    }
    100% {
        transform: rotate(var(--original-rotation, 0deg)) scale(1);
        opacity: 0.85;
        filter: blur(0px);
    }
}

/* Apply animations via classes */
.polaroid-figure.push-away {
    animation: polaroidPushAway 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.polaroid-figure.return-home {
    animation: polaroidReturn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* SKIP LINK */
.skip-link {
    position: fixed;
    top: 40%;
    left: 0;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.2);
    color: transparent;
    font-size: 12px;
    font-weight: 500;
    border-radius: 0 4px 4px 0;
    z-index: 1000;
    text-decoration: none;
    transition: all 0.2s ease;
}

.skip-link:focus {
    color: #fff;
    background: rgba(59, 130, 246, 0.8);
    padding: 6px 14px;
    left: 0;
}

.memory-mode .skip-link {
    display: none;
}

@media (max-width: 768px) {
    .polaroid-figure {
        --polaroid-w: 240px;
        --polaroid-h: 200px;
        padding: 14px 14px 60px 14px;
        touch-action: manipulation; /* Improve touch responsiveness */
    }

    /* Reduce movement distance on mobile */
    .polaroid-figure.push-away {
        animation-name: polaroidPushAwayMobile;
    }

    .polaroid-figure.return-home {
        animation-name: polaroidReturnMobile;
    }

    @keyframes polaroidPushAwayMobile {
        0% {
            transform: rotate(var(--original-rotation, 0deg)) scale(1);
            opacity: 0.85;
        }
        100% {
            transform: rotate(var(--original-rotation, 0deg)) translate(calc(var(--push-x, 0px) * 0.6), calc(var(--push-y, 0px) * 0.6)) scale(0.85);
            opacity: 0.5;
        }
    }

    @keyframes polaroidReturnMobile {
        0% {
            transform: rotate(var(--original-rotation, 0deg)) translate(calc(var(--push-x, 0px) * 0.6), calc(var(--push-y, 0px) * 0.6)) scale(0.85);
            opacity: 0.5;
        }
        100% {
            transform: rotate(var(--original-rotation, 0deg)) scale(1);
            opacity: 0.85;
        }
    }

    /* Adjusted expansion scale for mobile */
    .polaroid-figure.expanded {
        transform: translate(-50%, -50%) scale(1.6) !important;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
    }

    /* Better mobile backdrop */
    .polaroid-backdrop {
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(4px);
    }
}

/* Additional mobile touch improvements */
@media (max-width: 480px) {
    .polaroid-figure {
        --polaroid-w: 200px;
        --polaroid-h: 170px;
        padding: 12px 12px 50px 12px;
    }

    .polaroid-caption {
        font-size: 11px;
        bottom: 32px;
    }

    .polaroid-secret {
        font-size: 9px;
        bottom: 10px;
    }

    .polaroid-figure.expanded {
        transform: translate(-50%, -50%) scale(1.8) !important;
    }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .polaroid-figure {
        border: 2px solid #000;
    }
    
    .polaroid-backdrop {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .polaroid-secret {
        color: #000;
        text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .polaroid-figure,
    .polaroid-backdrop {
        animation: none !important;
        transition: opacity 0.2s ease !important;
    }
    
    .polaroid-figure.push-away,
    .polaroid-figure.return-home {
        animation: none !important;
        transition: opacity 0.3s ease, transform 0.3s ease !important;
    }
}

/* Ensure proper layering in memory mode */
.memory-mode .polaroid-figure {
    display: block;
    animation: fadeInPolaroid 0.8s ease forwards;
}

.memory-mode .polaroid-figure:not(.expanded) {
    cursor: pointer;
}

.memory-mode .polaroid-figure.expanded {
    cursor: default;
}
