/* Root variables — color palette, shadows, and shared design tokens (dark-theme values) */
:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-light: #0f172a;
    --bg-gray: #1e293b;
    --text-dark: #f1f5f9;
    --text-light: #cbd5e1;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base styles: reset defaults and box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Header: sticky top bar with site title and navigation */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a:hover {
    color: var(--primary-color);
}

.hire-btn, .dark-btn {
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.hire-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dark-btn {
    background: transparent;
    font-size: 1.5rem;
    padding: 0.5rem;
    margin-left: 1rem;
}

.dark-btn:hover {
    transform: rotate(20deg);
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hero section: intro content, headline, and CTAs */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 5%;
    gap: 4rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 30px;
    margin: 2rem 3%;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-text {
    flex: 1;
    max-width: 600px;
    animation: fadeInLeft 1s ease;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.greeting {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.name-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typing-effect {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    min-height: 60px;
}

.cursor {
    display: inline-block;
    background-color: var(--primary-color);
    margin-left: 3px;
    width: 3px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
    padding: 0.9rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.secondary-btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-gray);
    color: var(--text-dark);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.social-icon:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Hero image: image container and animation for the hero portrait */
.myimage {
    flex: 0 0 auto;
    animation: fadeInRight 1s ease;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.image-container {
    position: relative;
    width: 350px;
    height: 350px;
}

.image-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 5px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.image-container:hover img {
    transform: scale(1.05);
}

.image-backdrop {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #000000;
    z-index: 1;
}

/* Section styles: common spacing and section header styles */
section {
    padding: 5rem 5%;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* About section: background, grid layout, and stats */
.about-section {
    background: var(--bg-gray);
    border-radius: 30px;
    margin: 2rem 3%;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text {
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lead-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Skills: skill items, headers, and animated progress bars */
.skills-container {
    animation: fadeIn 1s ease 0.3s backwards;
}

.skills-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.skill-item {
    margin-bottom: 2rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.skill-name {
    font-weight: 600;
    color: var(--text-dark);
}

.skill-percent {
    font-weight: 600;
    color: var(--primary-color);
}

.skill-bar {
    height: 10px;
    background: var(--border-color);
    border-radius: 50px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0;
    border-radius: 50px;
    transition: width 1.5s ease;
}

/* Projects: project card styles and responsive grid */
#projects {
    background: var(--bg-light);
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--bg-gray);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: var(--bg-gray);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(99, 102, 241, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: var(--transition);
}

.project-link:hover {
    transform: scale(1.1) rotate(10deg);
}

.project-content {
    padding: 1.8rem;
}

.project-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
}

.project-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.project-tags span {
    padding: 0.4rem 1rem;
    background: var(--bg-light);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

/* Contact section: contact info, details, and the message form */
#contact {
    background: var(--bg-gray);
    border-radius: 30px;
    margin: 2rem 3%;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.contact-info > p {
    color: var(--text-light);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: start;
    gap: 1.5rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.contact-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-dark);
}

.contact-item p {
    color: var(--text-light);
}

.contact-item p a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.contact-item p a:hover {
    color: var(--primary-color);
}

.contact-form {
    background: var(--bg-light);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Footer: copyright and quick links */
footer {
    background: var(--bg-gray);
    padding: 3rem 5%;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

footer p {
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.footer-socials a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-light);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.footer-socials a:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateY(-5px);
}

.footer-socials img {
    width: 20px;
    height: 20px;
    filter: invert(0.3);
}

body.dark-mode .footer-socials img {
    filter: invert(0.8);
}

/* Responsive rules: media queries for tablet and mobile layouts */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 3rem 5%;
    }
    
    .hero-text {
        max-width: 100%;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .image-container {
        width: 280px;
        height: 280px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 5%;
    }
    
    .hamburger {
        display: block;
    }
    
    /* Mobile: simple dropdown menu under the header to avoid horizontal scrolling */
    nav ul {
        position: absolute;
        top: 100%; /* directly below the header */
        left: 0;
        width: 100%;
        height: auto;
        background: var(--bg-light);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 1rem;
        box-shadow: var(--shadow-lg);
        transition: transform 0.25s ease, opacity 0.25s ease;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        align-items: flex-start;
        border-top: 1px solid var(--border-color);
        z-index: 999; /* above page content but below header if needed */
    }

    nav ul.show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Prevent background scrolling while mobile nav is open */
    body.nav-open {
        overflow: hidden;
    }
    
    .name-title {
        font-size: 2.5rem;
    }
    
    .typing-effect {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-container {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 5%;
        margin: 1rem 2%;
    }
    
    .name-title {
        font-size: 2rem;
    }
    
    .typing-effect {
        font-size: 1.2rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
        justify-content: center;
    }
    
    .image-container {
        width: 220px;
        height: 220px;
    }
    
    section {
        padding: 3rem 5%;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
}

/* Fade-in: simple fade/slide reveal used with IntersectionObserver */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}
