/* Custom CSS for Ben Gervais Landing Page */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap'); /* legacy, will be overridden below */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --tertiary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --accent-glow: rgba(102, 126, 234, 0.3);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 16px 64px rgba(0, 0, 0, 0.2);
    --shadow-strong: 0 24px 96px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-gradient);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, 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% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Language Selection Screen */
.language-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--dark-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.language-screen.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
}

.language-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 4rem 3rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.language-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.language-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: rotate 10s linear infinite;
    z-index: -1;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.language-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.btn-language {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    text-align: center;
    min-width: 200px;
}

.btn-language::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-language:hover::before {
    left: 100%;
}

.btn-language:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-medium);
}

.btn-language:active {
    transform: translateY(-2px) scale(1.01);
}

/* Main Content */
.main-content {
    padding: 3rem 0;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.profile-pic {
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.profile-avatar {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 5rem;
    color: var(--text-primary);
    position: relative;
    animation: profileGlow 3s ease-in-out infinite alternate;
}

.profile-avatar::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: var(--primary-gradient);
    border-radius: 50%;
    opacity: 0.1;
    z-index: -1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes profileGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.6));
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.2;
    }
}

.section-title {
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    text-align: center;
    position: relative;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.section-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    z-index: -1;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--secondary-gradient);
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.5);
}

/* Hero header tags */
.hero-tags {
    display: inline-flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-tag {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.hero-tag::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102,126,234,0.18), rgba(240,147,251,0.18));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hero-tag:hover::before {
    opacity: 1;
}

.hero-tag:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 2px 8px rgba(102,126,234,0.3);
}

.hero-tag i {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Link Tiles (fresh design) */
.links-section {
    margin-bottom: 4rem;
}

.link-item {
    animation: linkItemEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.link-item:nth-child(1) { animation-delay: 0.05s; }
.link-item:nth-child(2) { animation-delay: 0.1s; }
.link-item:nth-child(3) { animation-delay: 0.15s; }
.link-item:nth-child(4) { animation-delay: 0.2s; }
.link-item:nth-child(5) { animation-delay: 0.25s; }
.link-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes linkItemEntrance {
    0% { opacity: 0; transform: translateY(24px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.btn-link-custom {
    --accent-1: #6ea8fe;
    --accent-2: #e799ff;
    --tile-bg: rgba(12, 14, 28, 0.75);
    width: 100%;
    height: 180px;
    padding: 1.2rem;
    border-radius: 22px;
    border: 1px solid transparent;
    background: linear-gradient(var(--tile-bg), var(--tile-bg)) padding-box,
                linear-gradient(135deg, var(--accent-1), var(--accent-2)) border-box;
    color: var(--text-primary);
    text-decoration: none;
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: start;
    justify-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-link-custom::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 80% at 10% -10%, rgba(255,255,255,0.18), transparent 60%),
        radial-gradient(50% 40% at 100% 0%, rgba(255,255,255,0.06), transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.btn-link-custom:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 60px rgba(0,0,0,0.35), 0 8px 24px rgba(110,168,254,0.25);
}

.btn-link-custom:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(110,168,254,0.35), 0 16px 48px rgba(0,0,0,0.35);
}

.link-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.link-icon i {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.link-content { align-self: end; }

.link-title {
    margin-top: 0.6rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.link-description {
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Accent cycling per position for visual variety while staying uniform */
.links-section .row > div:nth-child(3n+1) .btn-link-custom { --accent-1:#6ea8fe; --accent-2:#b388ff; }
.links-section .row > div:nth-child(3n+2) .btn-link-custom { --accent-1:#ffb86b; --accent-2:#ff7eb3; }
.links-section .row > div:nth-child(3n+3) .btn-link-custom { --accent-1:#7cf3d7; --accent-2:#60a5fa; }

/* Change Language Button */
#changeLanguage {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

#changeLanguage::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

#changeLanguage:hover::before {
    left: 100%;
}

#changeLanguage:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

/* Responsive Design */
@media (max-width: 992px) {
    .btn-link-custom { height: 150px; padding: 1.2rem; }
    
    .link-icon {
        width: 45px;
        height: 45px;
        margin-bottom: 0.8rem;
    }
    
    .link-icon i {
        font-size: 1.3rem;
    }
    
    .link-title {
        font-size: 1rem;
    }
    
    .link-description {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .language-card {
        padding: 2.5rem 2rem;
        margin: 1rem;
        border-radius: 24px;
    }
    
    .btn-language {
        padding: 1.2rem 2rem;
        font-size: 1rem;
        min-width: 180px;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .profile-avatar {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 2.5rem;
    }
    
    .btn-link-custom { height: 130px; padding: 1rem; border-radius: 20px; }
    
    .link-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 0.6rem;
    }
    
    .link-icon i {
        font-size: 1.2rem;
    }
    
    .link-title {
        font-size: 0.95rem;
    }
    
    .link-description {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .language-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .btn-language {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        min-width: 160px;
    }
    
    .main-content {
        padding: 1.5rem 0;
    }
    
    .profile-avatar {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }
    
    .btn-link-custom { height: 110px; padding: 0.8rem; border-radius: 16px; }
    
    .link-icon {
        width: 35px;
        height: 35px;
        margin-bottom: 0.5rem;
    }
    
    .link-icon i {
        font-size: 1.1rem;
    }
    
    .link-title {
        font-size: 0.9rem;
    }
    
    .link-description {
        font-size: 0.7rem;
    }
    
    #changeLanguage {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Floating particles animation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Selection styling */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

/* Focus styles for accessibility */
.btn-language:focus,
.btn-link-custom:focus,
#changeLanguage:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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