:root {
    --bg-dark: #0a0e1a;
    --bg-card: #1a1f35;
    --bg-card-hover: #252b45;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --border: #2d3548;
}

[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --border: #e2e8f0;
}

[data-theme="light"] body {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
}

[data-theme="light"] body::before {
    background: 
        linear-gradient(90deg, rgba(99, 102, 241, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(99, 102, 241, 0.02) 1px, transparent 1px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%);
    min-height: 100vh;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 100px 100px;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
}

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

/* Header */
header {
    padding: 4rem 0 2rem;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Navigation */
.project-nav {
    background: rgba(26, 31, 53, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

[data-theme="light"] .project-nav {
    background: rgba(255, 255, 255, 0.8);
}

.project-nav .container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.project-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

[data-theme="light"] .project-nav a {
    color: var(--text-primary);
}

.project-nav a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.project-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Main Content */
main {
    padding: 2rem 0 6rem;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-weight: 700;
}

/* About Section */
.about-section {
    max-width: 800px;
    margin: 5rem auto 0;
    scroll-margin-top: 6rem;
}

.about-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    line-height: 1.8;
}

.about-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.skills-section {
    margin-top: 2.5rem;
}

.skills-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.skill-tag {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    color: #a5b4fc;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

[data-theme="light"] .skill-tag {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--accent);
    border-color: rgba(99, 102, 241, 0.25);
}

.skill-tag:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    border-color: var(--accent);
    transform: scale(1.05);
}

#projects h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Project Grid */
.project-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    scroll-margin-top: 6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(99, 102, 241, 0.3),
        0 0 60px rgba(99, 102, 241, 0.2);
}

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

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

.project-icon {
    font-size: 4rem;
    line-height: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    filter: grayscale(0.3);
    transition: all 0.4s ease;
}

.project-card:hover .project-icon {
    filter: grayscale(0);
    transform: scale(1.1) rotate(5deg);
}

.project-logo {
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    border-radius: 8px;
}

.project-content {
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-card .description {
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.project-card .details {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-card .details a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.project-card .details a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

.project-card .details a:visited {
    color: var(--accent);
}

.project-card .details a:visited:hover {
    color: var(--accent-hover);
}

.highlights {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::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.5s ease;
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.project-tech {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.tech-tag {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    color: #a5b4fc;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    border-color: var(--accent);
    transform: scale(1.05);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
}

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

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .project-nav .container {
        gap: 1rem;
    }
    
    .project-nav a {
        font-size: 0.9rem;
    }
    
    .project-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-icon {
        font-size: 3rem;
        justify-content: flex-start;
    }
    
    .project-card h3 {
        font-size: 1.5rem;
    }
    
    .project-card .description {
        font-size: 1rem;
    }
    
    .highlights {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .project-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
