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

:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent: #ab16dd;
    --border: #d2d2d7;
    --shadow: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
}

[data-theme="dark"] {
    --primary-bg: #1d1d1f;
    --secondary-bg: #1d1d1f;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --accent: #ab16dd;
    --border: #424245;
    --shadow: rgba(255, 255, 255, 0.1);
    --card-bg: #1d1d1f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-bg);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
}

[data-theme="dark"] nav.scrolled {
    background: rgba(29, 29, 31, 0.8);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.theme-toggle {
    background: none;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle:hover {
    background: var(--border);
    transform: scale(1.1);
}

.theme-icon {
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
}

.theme-icon path {
    fill: var(--text-primary);
    transition: all 0.3s ease;
}

.moon-icon {
    opacity: 1;
}

.sun-icon {
    opacity: 0;
}

[data-theme="dark"] .moon-icon {
    opacity: 0;
}

[data-theme="dark"] .sun-icon {
    opacity: 1;
}

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

.hero-content {
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5.75rem);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 100%;
    padding: 0 20px;
    text-align: center;
}

.cta-button {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
    margin: 10px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 122, 255, 0.4);
}

/* Projects Section */
.projects {
    padding: 100px 0;
    background: var(--secondary-bg);
}

.section-title {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(30px);
}

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

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow);
    transition: all 0.5s ease;
    opacity: 0;
    transform: translateY(50px);
    border: 1px solid var(--border);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px var(--shadow);
}

.project-image {
    width: 100%;
    height: auto;
    background: linear-gradient(135deg, var(--accent), #5856d6);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-content {
    padding: 20px;
}

.project-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.4;
}

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

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-title {
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 2.2;
}

.tech-tag {
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

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

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

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .nav-content {
        padding: 10px 0;
    }
    
    .hero {
        padding: 0 20px;
    }
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #005bb5;
}