/* Import fonts and base variables */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #00fff2;
    --secondary-color: #ff00ea;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 30, 0.8);
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 255, 242, 0.2);
    --hover-glow: rgba(0, 255, 242, 0.3);
}

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

html {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    background-attachment: fixed;
    background-size: 100% 100%;
    color: var(--text-color);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: none;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overscroll-behavior: none;
    position: relative;
    line-height: 1.6;
}

/* Header Styles */
.projects-header {
    padding: 2rem 5%;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-left {
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.glitch {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    color: var(--primary-color);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 15px rgba(0, 255, 242, 0.15));
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.glitch:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--primary-color))
            drop-shadow(0 0 20px var(--primary-color));
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--secondary-color);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--primary-color);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(39px, 9999px, 88px, 0); }
    20% { clip: rect(96px, 9999px, 12px, 0); }
    40% { clip: rect(45px, 9999px, 73px, 0); }
    60% { clip: rect(22px, 9999px, 56px, 0); }
    80% { clip: rect(71px, 9999px, 34px, 0); }
    100% { clip: rect(8px, 9999px, 91px, 0); }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-tagline {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: rgba(255, 255, 255, 0.8);
    min-height: 2rem;
    font-weight: 300;
    letter-spacing: 0.1rem;
    user-select: none;
    text-align: right;
}

.typed-text {
    color: var(--primary-color);
    font-weight: 500;
}

.cursor {
    animation: blink 1s infinite;
    color: var(--primary-color);
    font-weight: 700;
}

.cursor::after {
    content: '|';
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.social-links {
    display: flex;
    gap: 1.2rem;
    justify-content: flex-end;
    align-items: center;
}

.social-icon {
    width: 36px;
    height: 36px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 255, 242, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.social-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--hover-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-icon:hover::before {
    opacity: 1;
}

.social-icon:hover {
    background: rgba(0, 255, 242, 0.2);
    box-shadow: 0 5px 20px rgba(0, 255, 242, 0.3);
    /* transform removed - handled by JavaScript for rotate effect */
}

.social-icon svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* SVG transform removed - handled by parent JavaScript */

/* Page Title Section */
.page-title-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 5% 2rem;
    text-align: center;
}

.page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Contact Container */
.contact-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 5% 6rem;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.contact-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.6s ease-out forwards;
    opacity: 0;
}

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

.contact-card:nth-child(1) { animation-delay: 0.1s; }
.contact-card:nth-child(2) { animation-delay: 0.2s; }
.contact-card:nth-child(3) { animation-delay: 0.3s; }
.contact-card:nth-child(4) { animation-delay: 0.4s; }
.contact-card:nth-child(5) { animation-delay: 0.5s; }
.contact-card:nth-child(6) { animation-delay: 0.6s; }

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(0, 255, 242, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px rgba(0, 255, 242, 0.2);
}

.contact-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 255, 242, 0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.contact-card:hover .card-icon {
    background: rgba(0, 255, 242, 0.2);
    transform: scale(1.1) rotate(5deg);
}

.card-icon svg {
    width: 30px;
    height: 30px;
    color: var(--primary-color);
}

.contact-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.contact-link:hover::after {
    width: calc(100% - 30px);
}

.contact-link:hover {
    gap: 0.8rem;
}

.contact-link svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.contact-link:hover svg {
    transform: translate(3px, -3px);
}

/* Contact Form Section */
.contact-form-section {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    animation: cardFadeIn 0.6s ease-out 0.7s forwards;
    opacity: 0;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 255, 242, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    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 ease, height 0.6s ease;
}

.submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 242, 0.4);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn span,
.submit-btn svg {
    position: relative;
    z-index: 1;
}

.submit-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.submit-btn:hover svg {
    transform: translate(3px, -3px) rotate(15deg);
}

/* Footer */
.projects-footer {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 5%;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

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

.footer-links a:hover::after {
    width: 100%;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .contact-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .projects-header {
        padding: 1.5rem 5%;
    }

    /* Stack header elements vertically */
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        text-align: center;
    }
    
    .header-left {
        width: 100%;
    }

    .header-right {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 1.5rem;
    }

    /* Increase logo size on mobile */
    .glitch {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .header-tagline {
        min-width: unset;
        text-align: center;
        width: 100%;
    }
    
    /* Better social icon spacing */
    .social-links {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .social-icon {
        width: 42px;
        height: 42px;
    }
    
    .social-icon svg {
        width: 22px;
        height: 22px;
    }

    .page-title-section {
        padding: 3rem 5% 1.5rem;
    }

    .contact-container {
        padding: 2rem 5% 4rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-form-section {
        padding: 2rem 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* Larger logo on small screens */
    .glitch {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .social-icon {
        width: 48px;
        height: 48px;
    }
    
    .social-icon svg {
        width: 24px;
        height: 24px;
    }

    .page-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .page-subtitle {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
    }

    .contact-card {
        padding: 1.5rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
    }

    .card-icon svg {
        width: 24px;
        height: 24px;
    }

    .contact-card h3 {
        font-size: 1.2rem;
    }

    .submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Ripple animation for social icons */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}
