/* Custom styling for Kurt Angelo's portfolio */

/* Locomotive Scroll overrides */
html.has-scroll-smooth {
    overflow: hidden;
}

html.has-scroll-dragging {
    user-select: none;
}

.has-scroll-smooth body {
    overflow: hidden;
}

.has-scroll-init {
    overflow: hidden;
}

.c-scrollbar {
    position: absolute;
    right: 0;
    top: 0;
    width: 11px;
    height: 100%;
    transform-origin: center right;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
}

.c-scrollbar:hover {
    transform: scaleX(1.45);
}

.c-scrollbar:hover,
.has-scroll-scrolling .c-scrollbar,
.has-scroll-dragging .c-scrollbar {
    opacity: 1;
}

.c-scrollbar_thumb {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(180deg, #666666, #333333);
    opacity: 0.5;
    width: 7px;
    border-radius: 10px;
    margin: 2px;
    cursor: grab;
}

.has-scroll-dragging .c-scrollbar_thumb {
    cursor: grabbing;
}

/* Global styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    color: #333333;
    line-height: 1.8;
    overflow-x: hidden;
    letter-spacing: 0.3px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.5px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #666666, #333333);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #333333, #666666);
}

/* Selection color */
::selection {
    background-color: #333333;
    color: #ffffff;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #333333, #666666, #999999);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Transition effects */
.transition {
    transition: all 0.3s ease;
}

/* Navigation */
nav {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
}

nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.98) !important;
}

/* Navigation link animations */
nav ul li a {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #999999, #333333);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a:hover {
    transform: translateY(-2px);
}

/* Hero section */
#hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 50%, #f5f5f5 100%);
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(153, 153, 153, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, 20px) scale(1.1); }
}

/* Hero welcome badge */
#hero .inline-block {
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.typing-text, .typing-subtitle {
    display: inline-block;
}

/* Enhanced chevron animation */
.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
        opacity: 1;
    }
    50% {
        transform: translateY(-15px) translateX(-50%);
        opacity: 0.7;
    }
}

/* Hero buttons with enhanced hover effects */
.hero-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hero-btn:hover::before {
    width: 300px;
    height: 300px;
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(51, 51, 51, 0.2);
}

/* About section profile image */
.profile-container {
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-container:hover {
    transform: translateY(-10px);
}

.profile-container .profile-border {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(51, 51, 51, 0.1);
}

.profile-container:hover .profile-border {
    transform: translate(-8px, -8px);
    box-shadow: 0 15px 40px rgba(51, 51, 51, 0.15);
}

.profile-container img {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-container:hover img {
    box-shadow: 0 20px 50px rgba(51, 51, 51, 0.2);
}

/* Smooth expand animation for More About Me */
#more-about {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s ease,
                margin-top 0.6s ease;
    opacity: 0;
    margin-top: 0;
}

#more-about.show {
    max-height: 500px;
    opacity: 1;
    margin-top: 1rem;
}

/* Social icons animation */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.social-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(45deg, #333333, #999999);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.social-icon:hover::before {
    opacity: 0.2;
}

.social-icon:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(51, 51, 51, 0.3);
}

/* Projects section card effects */
.project-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.7s ease;
    z-index: 1;
}

.project-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #999999, #333333, #666666);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover::after {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(51, 51, 51, 0.18), 0 5px 15px rgba(51, 51, 51, 0.1);
    border-color: rgba(51, 51, 51, 0.1);
}

.project-card img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.project-card:hover img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

/* Stagger animation for grid items */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: staggerFadeIn 0.6s ease forwards;
}

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Skills section card effects */
.skill-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(51, 51, 51, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.skill-card:hover::after {
    opacity: 1;
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(51, 51, 51, 0.12);
}

/* Skill item icon animation */
.skill-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item .skill-icon {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item:hover .skill-icon {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(51, 51, 51, 0.2);
}

.skill-item:hover {
    transform: translateX(8px);
}

/* Skills progress bars animation */
@keyframes progress {
    0% {
        width: 0;
    }
    100% {
        width: var(--progress-width);
    }
}

.skill-progress {
    position: relative;
    animation: progress 1.5s ease-in-out forwards;
}

/* Certificate card effects */
.certificate-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.certificate-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #333333, #666666, #999999);
    border-radius: 0.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.certificate-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, transparent 50%, rgba(51, 51, 51, 0.05) 50%);
    border-radius: 0 0.5rem 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.certificate-card:hover::before {
    opacity: 1;
}

.certificate-card:hover::after {
    opacity: 1;
}

.certificate-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(51, 51, 51, 0.22), 0 10px 20px rgba(51, 51, 51, 0.12);
    border-color: rgba(51, 51, 51, 0.1);
}

.certificate-card img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.certificate-card:hover img {
    transform: scale(1.05);
    filter: brightness(1.03);
}

/* Contact form focus effects */
input, textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus, textarea:focus {
    border-color: #333333;
    box-shadow: 0 0 0 4px rgba(51, 51, 51, 0.1);
    transform: translateY(-2px);
}

/* Contact info item hover */
.contact-info-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
    border-radius: 0.5rem;
}

.contact-info-item:hover {
    background-color: rgba(245, 245, 245, 0.5);
    transform: translateX(10px);
}

.contact-info-item .icon-container {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-info-item:hover .icon-container {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(51, 51, 51, 0.15);
}

/* Button animations */
.btn-submit {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-submit:hover::after {
    width: 300px;
    height: 300px;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(51, 51, 51, 0.25);
}

/* Custom animations */
.fade-in {
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in up animation */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section title animation */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #999999, #333333, #999999);
    animation: titleUnderline 1s ease forwards;
}

@keyframes titleUnderline {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 60px;
        opacity: 1;
    }
}

/* Utility classes */
.section-padding {
    padding-top: 100px;
    padding-bottom: 100px;
}

.bg-pattern {
    background-image: url('../img/pattern.png');
    background-repeat: repeat;
    background-size: 200px;
    background-opacity: 0.05;
}

/* Border animation effect */
.border-animation {
    position: relative;
}

.border-animation::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #333333;
    transition: width 0.3s ease;
}

.border-animation:hover::after {
    width: 100%;
}

/* Pulse animation for badges */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Shimmer loading effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, #f5f5f5 0%, #e0e0e0 50%, #f5f5f5 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Ripple effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* Smooth page transitions */
@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    animation: pageLoad 0.5s ease-in;
}

/* Enhanced mobile menu animation */
#mobile-menu li {
    transform: translateX(-20px);
    opacity: 0;
}

/* Tool badge hover effect */
.tool-badge {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.tool-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 12px rgba(51, 51, 51, 0.18);
    background: linear-gradient(135deg, #333333, #666666);
    color: white;
    border-color: #333333;
}

/* Back to top button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #333333, #666666);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 4px 15px rgba(51, 51, 51, 0.3);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(51, 51, 51, 0.4);
    background: linear-gradient(135deg, #666666, #999999);
}

#back-to-top i {
    font-size: 20px;
}

/* Enhanced section backgrounds */
section {
    position: relative;
}

section#about::before,
section#skills::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(153, 153, 153, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

section#projects::before,
section#certificates::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(51, 51, 51, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

/* Enhanced footer */
footer {
    background: linear-gradient(135deg, #2a2a2a, #333333, #3d3d3d);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #666666, transparent);
}

footer a {
    position: relative;
    transition: all 0.3s ease;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: white;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

footer .w-10 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

footer .w-10:hover {
    transform: translateY(-3px) scale(1.1);
}

/* Loading skeleton for images */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Locomotive Scroll smooth animations */
[data-scroll] {
    will-change: transform;
}

/* Fade in elements as they enter viewport */
[data-scroll].is-inview {
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

/* Parallax speed variations */
[data-scroll-speed] {
    transition: transform 0.1s linear;
}

/* Smooth reveal animations */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-text.is-inview {
    opacity: 1;
    transform: translateY(0);
}

/* Prevent layout shifts during scroll initialization */
.has-scroll-init [data-scroll-section] {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.has-scroll-smooth [data-scroll-section] {
    opacity: 1;
}

/* Enhanced smooth scrolling performance */
[data-scroll-container] {
    min-height: 100vh;
}

/* Fixed elements compatibility */
nav {
    position: fixed;
    z-index: 1000;
}

#back-to-top {
    position: fixed;
    z-index: 999;
}

/* GSAP Animation Styles */
/* ==================== */

/* Hero Section GSAP Elements */
.gsap-hero-badge,
.gsap-hero-title,
.gsap-hero-subtitle,
.gsap-hero-tagline,
.gsap-hero-buttons {
    will-change: transform, opacity;
}

/* Profile Animation */
.gsap-profile {
    will-change: transform, opacity;
    transform-style: preserve-3d;
}

/* Card Animations */
.gsap-project-card,
.gsap-skill-card,
.gsap-certificate-card {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Certificate Card 3D Flip Effect */
.gsap-certificate-card {
    perspective: 1000px;
}

/* Magnetic Button Effect */
.hero-btn,
.btn-submit {
    will-change: transform;
    transform-style: preserve-3d;
}

/* Tool Badge Enhanced */
.tool-badge {
    will-change: transform, background, color;
    transform-origin: center;
}

/* Skill Icon Parallax */
.skill-icon {
    will-change: transform;
}

/* Section Title Animation */
.section-title {
    --underline-width: 60px;
}

/* Social Icons GSAP */
.social-icon {
    transform-origin: center;
    will-change: transform;
}

/* Form Input GSAP Focus */
input,
textarea {
    will-change: transform;
}

/* Smooth GSAP transitions */
.gsap-smooth {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Prevent flash of unstyled content during GSAP init */
.gsap-hero-badge,
.gsap-hero-title,
.gsap-hero-subtitle,
.gsap-hero-tagline,
.gsap-hero-buttons a {
    opacity: 0;
}

/* Loading state will be overridden by GSAP */
body.gsap-loaded .gsap-hero-badge,
body.gsap-loaded .gsap-hero-title,
body.gsap-loaded .gsap-hero-subtitle,
body.gsap-loaded .gsap-hero-tagline,
body.gsap-loaded .gsap-hero-buttons a {
    opacity: 1;
}

/* Enhance 3D transforms */
.gsap-3d-transform {
    transform-style: preserve-3d;
    perspective: 1000px;
}