/* Professional Facade - The mask before the glitch */
.facade-layer {
    position: fixed;
    top: 0 !important;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 10000;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: opacity 0.5s ease;
    transform: none !important;
}

.facade-layer.glitching {
    animation: facade-glitch 5s ease-out forwards;
}

/* Hide text elements during glitch but keep photo container visible */
.facade-layer.glitching .professional-name,
.facade-layer.glitching .professional-title,
.facade-layer.glitching .professional-bio,
.facade-layer.glitching .bio-heading,
.facade-layer.glitching .professional-links {
    animation: text-disappear 1s ease-out forwards;
}

@keyframes text-disappear {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1) skewX(10deg);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) skewX(-10deg);
        filter: blur(10px);
    }
}

@keyframes facade-glitch {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    5% {
        transform: scale(1.01) translate(-2px, 0);
        filter: hue-rotate(90deg);
    }
    10% {
        transform: scale(0.99) translate(2px, -2px);
        filter: hue-rotate(180deg) saturate(2);
    }
    15% {
        transform: scale(1.02) translate(-1px, 2px);
        filter: hue-rotate(270deg) contrast(2);
    }
    20% {
        opacity: 1;
        transform: scale(1) translate(0, 0);
        filter: hue-rotate(0deg);
    }
    25% {
        opacity: 0.8;
        transform: scaleY(1.1) skewX(5deg);
    }
    30% {
        opacity: 0.6;
        transform: scaleY(0.9) skewX(-5deg);
        filter: blur(1px);
    }
    35% {
        opacity: 0.4;
        transform: scale(1.1);
        filter: blur(2px) brightness(2);
    }
    40% {
        opacity: 0.2;
        transform: scale(0.9);
        filter: blur(5px) brightness(5);
    }
    45% {
        opacity: 1; /* Keep visible for childhood photo */
        transform: scale(1);
        filter: none;
    }
    90% {
        opacity: 1; /* Stay visible */
    }
    100% {
        opacity: 0;
        display: none;
    }
}

.professional-container {
    max-width: 800px;
    text-align: center;
    padding: 3rem 2rem;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Keep container centered when only photo remains */
.facade-layer.glitching .professional-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Hide newsletter immediately when glitching starts */
.facade-layer.glitching .newsletter-signup {
    display: none !important;
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: 300;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
}

.profile-image .initials-fallback {
    display: none; /* Only show if images fail to load */
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 300;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
}

.profile-image .facade-photo {
    z-index: 2;
    transition: all 0.5s ease;
}

.profile-image .true-self-photo {
    z-index: 1;
    filter: brightness(1.2) contrast(1.5) saturate(0);
}

/* Photo glitch states */
.profile-image.glitching .facade-photo {
    animation: photo-glitch 0.8s ease-out forwards;
    animation-delay: 0.2s; /* Small delay after text starts disappearing */
}

.profile-image.reveal-true-self .facade-photo {
    opacity: 0;
    transform: scale(1.1) rotate(5deg);
}

.profile-image.reveal-true-self .true-self-photo {
    display: block !important;
    animation: true-self-reveal 2s ease-out forwards;
}

@keyframes photo-glitch {
    0% {
        filter: none;
        transform: translateX(0);
    }
    10% {
        filter: hue-rotate(90deg) saturate(2);
        transform: translateX(-5px);
    }
    20% {
        filter: hue-rotate(180deg) brightness(1.5);
        transform: translateX(5px) scaleX(1.1);
    }
    30% {
        filter: hue-rotate(270deg) contrast(2);
        transform: translateY(-5px);
    }
    40% {
        filter: invert(1);
        transform: translateY(5px) rotate(-5deg);
    }
    50% {
        opacity: 0.5;
        filter: brightness(2) blur(2px);
    }
    60% {
        opacity: 0.3;
        transform: scale(0.95) rotate(10deg);
    }
    80% {
        opacity: 0.1;
        filter: blur(5px);
    }
    100% {
        opacity: 0;
        transform: scale(1.2) rotate(15deg);
        filter: blur(10px);
    }
}

@keyframes true-self-reveal {
    0% {
        filter: brightness(0) contrast(2) saturate(0);
        transform: scale(0.8) rotate(-15deg);
        opacity: 0;
    }
    20% {
        filter: brightness(2) contrast(3) saturate(0) hue-rotate(90deg);
        opacity: 0.5;
        transform: scale(1.05) rotate(-10deg);
    }
    40% {
        filter: brightness(1.5) contrast(2) saturate(0.5) hue-rotate(180deg);
        opacity: 0.8;
        transform: scale(0.95) rotate(5deg);
    }
    60% {
        filter: brightness(1.2) contrast(1.8) saturate(1) hue-rotate(270deg);
        transform: scale(1.02) rotate(-3deg);
    }
    80% {
        filter: brightness(1.1) contrast(1.5) saturate(1.5) hue-rotate(360deg);
        transform: scale(0.98) rotate(1deg);
    }
    100% {
        filter: 
            brightness(1.3) 
            contrast(1.8) 
            saturate(0.8) 
            sepia(0.3)
            hue-rotate(90deg)
            drop-shadow(0 0 20px #39FF14)
            drop-shadow(0 0 40px #39FF14);
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Evil/corrupted effect overlay */
.profile-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
    background: 
        radial-gradient(circle at 30% 30%, transparent 30%, rgba(57, 255, 20, 0.3) 70%),
        radial-gradient(circle at 70% 70%, transparent 30%, rgba(255, 16, 240, 0.2) 70%);
    mix-blend-mode: screen;
    pointer-events: none;
    transition: opacity 1s ease;
}

.profile-image.reveal-true-self::after {
    opacity: 1;
    animation: evil-pulse 2s ease-in-out infinite;
}

@keyframes evil-pulse {
    0%, 100% {
        transform: scale(1);
        filter: blur(0);
    }
    50% {
        transform: scale(1.1);
        filter: blur(2px);
    }
}

.profile-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.professional-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
    transition: all 0.2s ease;
    display: inline-block;
}

.professional-title {
    font-size: 1.15rem;
    color: #888;
    margin: 0 0 0.75rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.professional-bio {
    max-width: 650px;
    margin: 0 auto 1.5rem;
    text-align: left;
}

.bio-heading {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.professional-bio p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 400;
}

.professional-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.professional-link {
    padding: 0.5rem 1.2rem;
    background: #e8e8e8 !important;
    color: #000000 !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 400;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    border: 1px solid #d0d0d0;
    display: inline-block;
}

.professional-link:hover {
    background: #d8d8d8 !important;
    color: #000000 !important;
    text-decoration: none;
    /* No transform, no shadow - utterly boring */
}

/* Newsletter Signup - Minimalist Corporate */
.newsletter-signup {
    margin-top: 3rem;
    padding: 2rem;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.newsletter-signup.newsletter-minimal {
    margin-top: 1rem;
    padding: 0;
    background: transparent;
    border: none;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-signup.newsletter-minimal.newsletter-top {
    margin-top: 0;
    margin-bottom: 2rem;
}

.newsletter-minimal .newsletter-form {
    display: flex;
    gap: 0;
    justify-content: center;
    margin-bottom: 0;
    border: 1px solid #ddd;
    border-radius: 24px;
    overflow: hidden;
    background: #f9f9f9;
}

.newsletter-minimal .newsletter-input {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.newsletter-minimal .newsletter-btn {
    padding: 0.5rem 1rem;
    background: #2c2c2c;
    border-radius: 0;
    font-size: 1.1rem;
    min-width: 45px;
}

.newsletter-heading {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.newsletter-text {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}

.newsletter-input::placeholder {
    color: #999;
}

.newsletter-btn {
    padding: 0.6rem 1.5rem;
    background: #2c2c2c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.newsletter-btn:hover {
    background: #1a1a1a;
}

.newsletter-disclaimer {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}


@keyframes newsletter-corrupt {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1) skewX(10deg);
        filter: hue-rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) skewX(-20deg);
        filter: blur(10px) saturate(0);
    }
}

/* Glitch hints - subtle at first */
.facade-layer.pre-glitch .professional-name {
    animation: subtle-glitch 0.5s ease-in-out infinite;
}

/* Removed color shifts - too distracting */

.facade-layer.pre-glitch .profile-image {
    animation: subtle-hue-shift 3s ease-in-out infinite;
}

@keyframes subtle-glitch {
    0%, 100% { 
        text-shadow: none;
        transform: translate(0);
    }
    92% {
        text-shadow: none;
        transform: translate(0);
    }
    95% {
        text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
        transform: translate(-1px, 1px);
    }
    97% {
        text-shadow: -2px 2px 0 rgba(0,0,0,0.1);
        transform: translate(1px, -1px);
    }
}

/* Keep only subtle hue shift for profile image */
@keyframes subtle-hue-shift {
    0%, 100% {
        filter: none;
    }
    80% {
        filter: none;
    }
    85% {
        filter: brightness(1.05);
    }
    90% {
        filter: brightness(0.95);
    }
    95% {
        filter: contrast(1.1);
    }
}

/* Static noise overlay */
.glitch-static {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: 10001;
    background-image: 
        repeating-radial-gradient(circle at 0 0, transparent 0, #000 2px, transparent 4px),
        repeating-radial-gradient(circle at 50% 50%, transparent 0, #fff 1px, transparent 3px);
    background-size: 50px 50px, 30px 30px;
    animation: static-noise 0.1s steps(10) infinite;
}

.facade-layer.glitching ~ .glitch-static {
    opacity: 0.3;
}

@keyframes static-noise {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(5%, 5%); }
    30% { transform: translate(-5%, 5%); }
    40% { transform: translate(5%, -5%); }
    50% { transform: translate(-2%, -2%); }
    60% { transform: translate(2%, 2%); }
    70% { transform: translate(-2%, 2%); }
    80% { transform: translate(2%, -2%); }
    90% { transform: translate(1%, 1%); }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .professional-name {
        font-size: 2rem;
    }
    
    .professional-title {
        font-size: 1.1rem;
    }
    
    .profile-image {
        width: 150px;
        height: 150px;
    }
    
    .professional-bio {
        font-size: 1rem;
    }
}