/* Reset and Base Styles */
:root {
    /* Apple Liquid Glass Palette */
    --glass-bg: rgba(255, 255, 255, 0.65); /* Frosted Glass Base */
    --glass-border: rgba(255, 255, 255, 0.5); /* Subtle Highlight */
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); /* Soft Depth */
    
    --primary-color: #007AFF; /* Apple Blue */
    --text-color: #1d1d1f; /* Apple Dark Grey */
    --text-secondary: #86868b; /* Apple Light Grey */
    
    --card-radius: 24px;
    --btn-radius: 14px; /* Apple-style squircles */
    --transition-speed: 0.3s;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; /* Native System Font */
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fbfbfd; /* Apple Off-White */
    position: relative;
    color: var(--text-color);
    font-weight: 400;
}

/* Fluid Abstract Background */
.background-overlay {
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    background-image: url('https://picsum.photos/seed/cxin/800/1200'); /* Keep user image base */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(80px) saturate(150%); /* Extreme blur for liquid color wash */
    opacity: 0.6;
    z-index: -1;
}

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

/* Main Container */
.container {
    width: 100%;
    max-width: 850px; /* Slightly narrower for compact look */
    padding: 20px;
    z-index: 1;
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%; /* Full height to center properly */
}

/* Card Styling - Desktop Liquid Glass */
.card {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    width: 100%;
    height: 500px;
    transition: transform 0.3s ease;
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

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

.card-left {
    flex: 0 0 40%;
    height: 100%; /* Ensure full height */
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    font-size: 0; /* Eliminate whitespace gaps */
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Remove inline gap */
    transition: transform 0.5s ease;
}

.card-left:hover .profile-img {
    /* transform: scale(1.05); Removed zoom on hover */
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 70%, rgba(49, 46, 129, 0.4)); /* Indigo tint */
}

.card-right {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Push content apart */
    /* Removed overflow-y to force fit, content should be concise */
}

/* Ensure content is centered vertically in its available space */
.mobile-block-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobile-block-action {
    /* Container for action buttons and footer */
}

/* Content Typography */
h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 42px; /* Large size jump */
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #1f2937 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.5px; /* Tight spacing */
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.highlight-name {
    font-family: 'Space Grotesk', sans-serif; /* Consistent technical font */
    font-size: 1.2em; /* Relative to h1 */
    font-weight: 700;
    letter-spacing: -1px;
    
    /* Metallic Shine Gradient - Dark Gold/Bronze/Indigo Mix for contrast against white */
    background: linear-gradient(
        110deg,
        #1e1b4b 10%,      /* Very Dark Indigo */
        #4f46e5 30%,      /* Vivid Indigo */
        #fbbf24 45%,      /* Gold Highlight */
        #f59e0b 50%,      /* Amber/Gold Core */
        #fbbf24 55%,      /* Gold Highlight */
        #4f46e5 70%,      /* Vivid Indigo */
        #1e1b4b 90%       /* Very Dark Indigo */
    );
    background-size: 200% auto;
    
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    position: relative;
    padding: 0 5px;
    
    /* Stronger Shadow for contrast */
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
    
    animation: metalShine 6s linear infinite;
}

.wave-emoji {
    font-size: 1.3em; /* Larger size */
    cursor: pointer;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    position: relative;
    
    /* Reset text fill color so emoji is visible (overrides h1 gradient text) */
    -webkit-text-fill-color: initial;
    text-shadow: none;
}

.wave-emoji:hover {
    transform: rotate(15deg) scale(1.1);
}

.wave-emoji:active {
    transform: scale(0.9) rotate(-10deg);
}

/* High Five Sparkles */
.sparkle {
    position: absolute;
    pointer-events: none;
    animation: sparkleAnim 0.8s ease-out forwards;
    font-size: 20px;
    z-index: 100;
}

@keyframes sparkleAnim {
    0% { transform: translate(0, 0) scale(0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1.5); opacity: 0; }
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast i {
    color: #6366f1;
    font-size: 16px;
}

@keyframes metalShine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Removed previous ::after marker style for cleaner metallic look */
/* 
.highlight-name::after { ... } 
*/

.intro {
    font-size: 14px; /* Smaller for contrast */
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 25px;
    font-weight: 200; /* Extreme light weight contrast */
}

.intro strong {
    color: var(--primary-color);
    font-weight: 800; /* Extreme bold weight contrast */
    position: relative;
    z-index: 1;
}

.intro strong::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: rgba(99, 102, 241, 0.15);
    z-index: -1;
    transform: skewX(-10deg);
}

/* Action Section */
.action-section {
    /* margin-top: auto; Removed to keep content grouped */
    margin-top: 15px;
}

.section-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label::after {
    content: '';
    height: 1px;
    flex: 1;
    background: linear-gradient(to right, #e5e7eb, transparent);
}

.buttons {
    display: flex;
    gap: 12px;
}

/* Buttons - Liquid Glass Style */
.btn {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    text-decoration: none;
    color: var(--primary-color); /* Colored text instead of white bg */
    background: rgba(255, 255, 255, 0.5); /* Semi-transparent */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 12px 16px;
    flex: 1;
    text-align: center;
    font-size: 14px;
    transition: all var(--transition-speed);
    border-radius: var(--btn-radius);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    letter-spacing: -0.2px;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Specific colors as subtle tints or gradients */
.btn-blog { color: #007AFF; }
.btn-github { color: #1d1d1f; }
.btn-gallery { color: #FF2D55; }

/* Removed old .btn-primary and general .btn:hover since specific classes handle it */

/* Footer Info */
.footer-info {
    /* margin-top removed as space-between handles it */
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    flex-direction: row; /* Changed to row for single line display */
    justify-content: space-between; /* Spread content */
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-info a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-info a:hover {
    color: var(--primary-color);
}

/* Removed old Music Player Widget styles */
/* .music-player, .album-art, .track-info, .player-controls... */

/* Customize APlayer to match theme */
/*
.aplayer {
    font-family: 'Space Grotesk', sans-serif !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    max-width: 400px;
    margin: 0;
}
*/

/* Fixed mode customization if used */
/*
.aplayer.aplayer-fixed {
    max-width: 400px;
    left: 20px;
    bottom: 20px;
    border-radius: 12px 12px 0 0 !important; /* Rounded top */
}
*/

/* Hide APlayer on very small screens or adjust */
@media (max-width: 768px) {
    /*
    .aplayer.aplayer-fixed {
        max-width: 100%;
        left: 0;
        bottom: 0;
        border-radius: 0 !important;
    }
    */
}

/* Responsive */
@media (max-width: 768px) {
    body {
        align-items: center; /* Center on mobile too */
        padding: 0; /* Remove padding to save space */
    }

    .container {
        height: 100%;
        padding: 0; /* Remove padding for full screen */
        margin-top: 0;
        max-width: 100%;
    }

    .card {
        flex-direction: column;
        max-height: none;
        height: 100vh;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        gap: 0; /* No gap */
    }
    
    .card-left {
        height: auto; /* Let it fill remaining space */
        flex: 1; /* Take up all available space above the sheet */
        min-height: 40vh; /* Ensure image is always visible */
        position: relative;
        clip-path: none; /* Remove cut */
        background: transparent;
        margin-bottom: 0;
        z-index: 0; /* Behind content */
    }
    
    /* iOS Style Gradient Overlay on Image */
    .card-left::after {
        display: block;
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 150px;
        background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.3)); /* Subtle shadow for depth */
        z-index: 1;
    }
    
    /* Mobile Card Right - iOS Sheet */
    .card-right {
        padding: 40px 30px 30px 30px; /* Comfortable spacing */
        /* flex: 1;  Removed to stop auto-expanding */
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        
        /* iOS Bottom Sheet Style */
        background: rgba(255, 255, 255, 0.75); /* More transparent */
        backdrop-filter: blur(40px) saturate(200%); /* Stronger iOS blur */
        -webkit-backdrop-filter: blur(40px) saturate(200%);
        border-radius: 35px 35px 0 0; /* Rounded top corners */
        margin-top: -50px; /* Overlap image */
        z-index: 10; /* Above image */
        box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.1); /* Depth shadow */
        border-top: 1px solid rgba(255, 255, 255, 0.8); /* Glass border highlight */
        
        min-height: 0;
        gap: 0;
        
        height: auto; /* Fit content height */
        /* Make sure it covers enough screen but doesn't force huge empty space */
        min-height: 50vh; 
        flex: 0 0 auto; /* Don't grow */
    }
    
    /* Optional: iOS Sheet Handle */
    .card-right::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 10px;
        margin: -15px auto 25px auto; /* Center top */
    }

    /* Reset Block Styles to be transparent */
    .mobile-block-info {
        background: transparent;
        padding: 0;
        clip-path: none;
        margin-bottom: 0;
        z-index: auto;
        flex: 0 0 auto;
    }

    .mobile-block-action {
        background: transparent;
        padding: 0;
        clip-path: none;
        z-index: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
        margin-top: 20px;
    }

    /* Content adjustments for better fit */
    .intro {
        font-size: 15px; /* Slightly smaller than 16px for better fit */
        margin-bottom: 10px;
        -webkit-line-clamp: 5; /* Allow more lines */
        line-height: 1.5;
    }

    h1 {
        font-size: 28px; /* Balanced size */
        margin-bottom: 8px;
    }
    
    .section-label {
        font-size: 12px;
        margin-bottom: 8px;
        margin-top: 5px;
    }
    
    .btn {
        padding: 12px 14px; /* Balanced touch targets */
        font-size: 14px;
    }
    
    .action-section {
        margin-top: 10px;
        flex: 0 0 auto; /* Don't force expand, let it sit naturally */
        margin-bottom: 10px;
    }
    
    .footer-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 10px;
        padding-top: 10px;
        padding-bottom: 20px; /* Ensure bottom spacing */
        margin-top: auto; /* Push to bottom if space exists */
        text-align: center;
        opacity: 0.8;
        flex-shrink: 0; /* Prevent footer from shrinking/disappearing */
    }
}
