/* Global Variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent: #4d9fff;
    --accent-hover: #6db0ff;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

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

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

.navbar {
    background: var(--bg-secondary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 1001;
}

.nav-brand h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    background: linear-gradient(135deg, var(--accent), #6db0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
    transition-delay: 0.5s;
    cursor: pointer;
}

.nav-brand:hover h2 {
    -webkit-text-fill-color: white;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    transition-delay: 0s;
}

.nav-brand h2::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 1px; /* border thickness */
    background: linear-gradient(135deg, var(--accent), #6db0ff);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: var(--transition);
    transition-delay: 0.1s;
}

.nav-brand:hover h2::before {
    opacity: 0;
    transition-delay: 0s;
}

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

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--accent);
}

.nav-menu a.nav-upwork {
    color: #14a800;
    font-weight: 600;
}

.nav-menu a.nav-upwork:hover {
    opacity: 0.8;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-primary);
}

[data-theme="dark"] .sun {
    display: inline;
}

[data-theme="dark"] .moon {
    display: none;
}

[data-theme="light"] .sun {
    display: none;
}

[data-theme="light"] .moon {
    display: inline;
}

.hero {
    padding: 6rem 0;
    background: var(--bg-secondary);
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-profile {
    margin-bottom: 2rem;
}

.profile-img {
    width: 100%;
    max-width: 350px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: contain;
    border: 4px solid var(--accent);
    box-shadow: 0 8px 16px var(--shadow);
    transition: var(--transition);
}

.profile-img:hover {
    transform: scale(1.05);
    border-color: #6db0ff;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent), #6db0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.8;
    min-height: 3.6rem; /* Reserve space for 2 lines of typed text to avoid layout shift */
}

/* Typed.js cursor style */
.typed-cursor {
    color: var(--accent);
    font-weight: 200;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

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

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

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

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

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--text-primary);
}

.hero-badges {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.upwork-badge {
    background: rgba(20, 168, 0, 0.1);
    color: #14a800;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #14a800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-cta {
    text-align: center;
    margin-top: 3rem;
}

section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

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

.testimonials-section {
    background: var(--bg-primary);
}

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

.testimonial-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow);
}

.testimonial-stars {
    color: #ffc107;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.testimonial-content {
    margin-bottom: 2rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.author-info h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.author-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px var(--shadow);
}

.project-image {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

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

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

.project-link {
    padding: 0.5rem 1.5rem;
    background: white;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--transition);
}

.project-link:hover {
    background: var(--accent);
    color: white;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.tech-tag {
    background: var(--bg-primary);
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

.about-section {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.about-text h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

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

.skill-category h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.skill-category li:before {
    content: "▹ ";
    color: var(--accent);
    font-weight: bold;
    margin-right: 0.5rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

@media (max-width: 480px) {
    .contact-form {
        padding: 1.5rem 1rem;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.1);
}

.success-message {
    margin-top: 1rem;
    padding: 1rem;
    background: #28a745;
    color: white;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

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

.social-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent);
}

.social-links a.upwork-link {
    color: #14a800;
}

.social-links a.upwork-link:hover {
    color: #14a800;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: -5px 0 15px var(--shadow);
        transition: 0.4s ease-in-out;
        z-index: 1000;
        gap: 1.5rem;
        display: none;
    }

    .nav-menu.active {
        display: flex;
        right: 0;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
        font-size: 1.2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

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

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

    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }

    .container {
        padding: 0 15px;
    }

    .section-title {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .hero-cta {
        flex-direction: column;
    }
}
