/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 10;
    position: relative;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #a8a8a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #a8a8a8;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

.hero-3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-3d canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.hero-starry-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-starry-bg canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Section Styles */
section {
    padding: 8rem 0;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #a8a8a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* About Section */
.about {
    background: linear-gradient(180deg, #0a0a0a 0%, #111111 100%);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: #cccccc;
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* Projects Section */
.projects {
    background: #0a0a0a;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.project-card {
    position: relative;
    z-index: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
}

.project-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
    position: relative;
}

.project-placeholder::before {
    content: "Project Preview";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.project-description {
    color: #a8a8a8;
    line-height: 1.6;
}

.project-card .project-content {
    position: relative;
    z-index: 1;
}

.project-card .project-light {
    z-index: 0;
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
}

.project-card:hover .project-light {
    opacity: 1;
}

/* Contact Section */
.contact {
    background: linear-gradient(180deg, #111111 0%, #0a0a0a 100%);
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: #cccccc;
    margin-bottom: 2rem;
}

.contact-email {
    position: relative;
    z-index: 0;
    display: inline-block;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: #ffffff;
    text-decoration: none;
    padding: 1rem 2rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.contact-email::before {
    z-index: 0;
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,0,255,0.7) 0%, rgba(128,0,255,0.6) 40%, rgba(128,0,255,0.0) 80%);
    opacity: 0;
    transition: opacity 0.3s, background 0.18s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
    border-radius: 50px;
}

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

.contact-email span {
    position: relative;
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .hero-tagline {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 12vw, 3rem);
    }
    
    .section-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }
    
    .about-text,
    .contact-text {
        font-size: 1rem;
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .project-card:hover {
        transform: none;
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: none;
    }
    
    .project-card:hover .project-light {
        opacity: 0;
    }
    
    .contact-email:hover::before {
        opacity: 0;
    }
}

/* Prevent unwanted touch interactions on touch devices */
@media (hover: none) and (pointer: coarse) {
    /* Prevent text selection on touch */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection on specific elements */
    p, h1, h2, h3, h4, h5, h6, span, a {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* Prevent zoom on double tap */
    * {
        touch-action: manipulation;
    }
    
    /* Ensure smooth scrolling */
    html {
        -webkit-overflow-scrolling: touch;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Locomotive Scroll Customization */
[data-scroll-container] {
    overflow: visible;
}

[data-scroll-section] {
    overflow: hidden;
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Project Modal Styles */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.project-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.project-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-modal.active .project-modal-container {
    transform: translate(-50%, -50%) scale(1);
}

.project-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.project-modal-content {
    padding: 40px;
    max-height: 90vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.project-modal-header {
    margin-bottom: 30px;
    text-align: center;
}

.project-modal-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #a8a8a8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-modal-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: #a8a8a8;
    line-height: 1.6;
}

.project-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.project-modal-gallery {
    display: grid;
    gap: 20px;
}

.project-modal-gallery img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.project-modal-gallery img:hover {
    transform: scale(1.02);
}

.project-modal-details {
    color: #cccccc;
    line-height: 1.8;
}

.project-modal-details h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.project-modal-details h3:first-child {
    margin-top: 0;
}

.project-modal-details p {
    margin-bottom: 1rem;
}

.project-modal-details ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.project-modal-details li {
    margin-bottom: 0.5rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .project-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .project-modal-content {
        padding: 20px;
    }
    
    .project-modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-modal-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .project-modal-content {
        padding: 15px;
    }
    
    .project-modal-title {
        font-size: 1.8rem;
    }
    
    .project-modal-subtitle {
        font-size: 1rem;
    }
} 