/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #e5e7eb;
    background-color: #0f172a;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.05) 0%, transparent 50%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #94a3b8;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #60a5fa;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Main content */
.main {
    margin-top: 80px;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e1b4b 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(96, 165, 250, 0.1) 50%, transparent 70%),
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.hero-name {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #f1f5f9;
    text-shadow: 0 0 20px rgba(241, 245, 249, 0.3);
    position: relative;
    z-index: 1;
    letter-spacing: 2px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #60a5fa, #3b82f6, #1d4ed8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
    color: #cbd5e1;
    position: relative;
    z-index: 1;
}

/* Section styles */
section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
    color: #f1f5f9;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    border-radius: 2px;
}

.section-note {
    margin-top: 0.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
}

/* About section */
.about {
    background: rgba(30, 41, 59, 0.3);
    border-top: 1px solid rgba(71, 85, 105, 0.2);
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
}

.about-text {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: #cbd5e1;
    line-height: 1.8;
}

/* Projects section */
.projects {
    background: rgba(15, 23, 42, 0.5);
}

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

.project-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

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

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

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #60a5fa;
    position: relative;
    z-index: 2;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Allow selective contain fit for wide/tall images */
.project-image img.fit-contain,
.project-detail-image img.fit-contain {
    object-fit: contain;
}

.project-image.emoji-only {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.project-content {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.project-year {
    font-size: 0.9rem;
    color: #60a5fa;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.project-summary {
    color: #cbd5e1;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tag {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.project-link {
    display: inline-block;
    margin-top: 1rem;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-link:hover {
    color: #3b82f6;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

/* Contact section */
.contact {
    background: rgba(30, 41, 59, 0.3);
    border-top: 1px solid rgba(71, 85, 105, 0.2);
}

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

.contact-content p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.contact-link:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Footer */
.footer {
    background: rgba(15, 23, 42, 0.9);
    color: #94a3b8;
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

/* Project detail page styles */
.project-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #60a5fa;
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #3b82f6;
    text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

.project-detail-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #f1f5f9;
}

.project-detail-year {
    font-size: 1rem;
    color: #60a5fa;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-detail-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #cbd5e1;
    margin-bottom: 2rem;
}

.project-detail-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #60a5fa;
    border: 1px solid rgba(71, 85, 105, 0.3);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.project-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Ensure detail images can be letterboxed without cropping when needed */
.project-detail-image img.fit-contain {
    object-fit: contain;
}

.project-detail-image.emoji-only {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.project-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.project-detail-tag {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.project-detail-link:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Project media gallery */
.project-media {
    margin-top: 2rem;
}

.project-media-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #f1f5f9;
}

.project-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.media-thumb {
    position: relative;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox-overlay.visible {
    display: flex;
}

.lightbox-inner {
    position: relative;
    width: min(92vw, 1100px);
    height: min(86vh, 800px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-body img,
.lightbox-body video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #1f2937;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(31,41,55,0.8);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav.prev { left: -60px; }
.lightbox-nav.next { right: -60px; }

.lightbox-caption {
    margin-top: 0.75rem;
    color: #e5e7eb;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-name {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: center;
    }
    
    .project-detail {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: #cbd5e1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(71, 85, 105, 0.3);
    border-top: 4px solid #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

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

/* Engineering-themed decorative elements */
.tech-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(96, 165, 250, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
}

/* Code-like terminal effect */
.terminal-text {
    font-family: 'Courier New', monospace;
    color: #10b981;
    text-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
}

/* Circuit board pattern */
.circuit-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(96, 165, 250, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(59, 130, 246, 0.1) 2px, transparent 2px);
    background-size: 30px 30px;
}
