:root {
    --primary: #0ea5e9;
    --secondary: #64748b;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --light: #0f172a;
    --dark: #f8fafc;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-700: #cbd5e1;
    --gray-800: #e2e8f0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

[data-theme="dark"] nav {
    background: rgba(15, 23, 42, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

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

.theme-toggle {
    background: none;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    border-color: var(--primary);
    transform: rotate(180deg);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--dark);
    transition: var(--transition);
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

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

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.1;
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -50px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.hero-content {
    text-align: center;
    max-width: 800px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

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

.hero-image {
    width: clamp(150px, 20vw, 200px);
    height: clamp(150px, 20vw, 200px);
    border-radius: 50%;
    margin: 0 auto 2rem;
    border: 5px solid var(--primary);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(3rem, 8vw, 5rem);
    color: white;
    font-weight: 700;
    animation: fadeInUp 1s ease 0.2s forwards;
    opacity: 0;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease 0.4s forwards;
    opacity: 0;
}

.hero .role {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--secondary);
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease 0.6s forwards;
    opacity: 0;
}

.hero .tagline {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--gray-700);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.8s forwards;
    opacity: 0;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    animation: fadeInUp 1s ease 1s forwards;
    opacity: 0;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: #0284c7;
}

/* Sections */
section {
    padding: clamp(3rem, 8vw, 6rem) 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
}

.bio {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.8;
    color: var(--gray-700);
}

.bio p {
    margin-bottom: 1.5rem;
}

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

.skill-card {
    background: var(--gray-100);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    background: var(--primary);
    color: white;
}

.skill-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Experience Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--gray-300);
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:nth-child(even) .timeline-content {
    grid-column: 2;
}

.timeline-item:nth-child(even)::before {
    left: auto;
    right: 50%;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: 4px solid var(--light);
    border-radius: 50%;
    z-index: 1;
}

.timeline-content {
    background: var(--gray-100);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.timeline-content h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-content .company {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.timeline-content .period {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
    padding: 0;
}

.timeline-content li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.timeline-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--gray-100);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}

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

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.project-content p {
    color: var(--gray-700);
    margin-bottom: 1rem;
}

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

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Skills Progress Bars */
.skills-progress {
    max-width: 800px;
    margin: 0 auto;
}

.skill-item {
    margin-bottom: 2rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.progress-bar {
    height: 12px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #38bdf8);
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
}

.progress-fill.animate {
    width: var(--width);
}

/* Contact Form */
.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--light);
    color: var(--dark);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    display: none;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
}

.form-group.error .form-error {
    display: block;
}

.submit-button {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.submit-button:hover {
    background: #0284c7;
    transform: translateY(-2px);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--dark);
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Footer */
footer {
    background: var(--gray-100);
    padding: 2rem;
    text-align: center;
    color: var(--gray-700);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--light);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray-700);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

/* Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--light);
        padding: 2rem;
        gap: 1rem;
        transform: translateX(-100%);
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .hamburger {
        display: flex;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .timeline-item:nth-child(even) .timeline-content {
        grid-column: 1;
    }

    .timeline-item::before {
        left: 0;
        transform: translateX(-50%);
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Success Message */
.success-message {
    display: none;
    padding: 1rem;
    background: #10b981;
    color: white;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
}

.success-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
