*,
*::before,
*::after {
    box-sizing: border-box;
    min-width: 0;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}


body.nav-open {
    overflow: hidden;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --card-bg: #1e293b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 1001;
}

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    position: relative;
    width: 45px;
    height: 45px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active {
    background: var(--primary);
    border-color: var(--primary);
}

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

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

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: float 20s infinite;
}

.hero::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: float 15s infinite reverse;
}

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

.hero-content {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text .subtitle {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-text .description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;  /* ADD THIS LINE */
    justify-content: center;  /* ADD THIS LINE */
}

.social-btn {
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 140px;
}

.social-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.social-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.social-btn:hover svg {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

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

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

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    color: white;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: 2rem;
    color: var(--success);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Section Styles */
section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s;
}

.skill-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

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

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));  /* Changed from 350px to 280px */
    gap: 2rem;
}
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.project-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

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

.tech-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--primary);
}

.project-body {
    padding: 1.5rem;
}

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

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

.project-link {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
}

.link-demo {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.link-demo:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.link-code {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.link-code:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Timeline Section */
.timeline {
    position: relative;
    padding-left: 0;
}

.timeline::before {
    display: none;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 0;
}

.timeline-item::before {
    display: none;
}

.timeline-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
}

.timeline-header {
    margin-bottom: 1rem;
}

.timeline-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

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

.timeline-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.timeline-description {
    color: var(--text-muted);
    line-height: 1.6;
}

.timeline-description ul {
    list-style: none;
    margin-top: 1rem;
}

.timeline-description li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

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

/* Footer */
footer {
    background: var(--dark-light);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 1rem;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s ease;
    margin: auto;
}

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

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary);
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 120px;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

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

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-message.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
    display: block;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
    display: block;
}

/* Responsive Design */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .social-links, .cta-buttons {
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 4rem 2rem;
    }
    
    .hero {
        padding: 6rem 2rem 4rem;
    }
    
    .nav-container {
        padding: 0 2rem;
    }
}

/* ===============================
   BODY LOCK WHEN MENU OPEN
================================ */
body.menu-open {
    overflow: hidden;
}

/* ===============================
   MOBILE NAVIGATION
================================ */
@media (max-width: 650px) {

    /* Fullscreen overlay menu */
    .nav-links {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;

        background: #0f172a;
        z-index: 999;

        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;

        padding-top: 90px;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Nav items */
    .nav-links li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-links li:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 1.8rem 2rem;

        font-size: 1.4rem;
        text-align: center;
        color: var(--text);

        transition: background 0.25s ease, color 0.25s ease;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(99, 102, 241, 0.25);
        color: var(--primary);
    }

    /* Hamburger button */
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }
}

/* ===============================
   RESPONSIVE LAYOUT TWEAKS
================================ */
@media (max-width: 768px) {
    section {
        padding: 3rem 1.5rem;
    }

    .hero {
        padding: 5rem 1.5rem 3rem;
    }

    .nav-container {
        padding: 0 1.5rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

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

    .hero-text .description {
        font-size: 1rem;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .hero-content,
    .profile-card,
    .project-card,
    .projects-grid,
    section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    
    .projects-grid {
        grid-template-columns: 1fr !important;
    }

    #contact .social-links {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: 0.75rem;
    }
    #contact .social-btn {
        flex: 1 1 calc(50% - 0.375rem);  /* 2 buttons per row */
        min-width: 140px;
        max-width: 200px;
        padding: 1rem 1.5rem !important;  /* Override inline styles */
        justify-content: center;
        font-size: 0.95rem;
    }
    #contact .social-btn span {
        font-size: 1.2rem;  /* Consistent emoji size */
        flex-shrink: 0;
        width: 24px;  /* Fixed width for icons */
        text-align: center;
    }

}

@media (max-width: 480px) {
    section {
        padding: 2.5rem 1rem;
    }

    .hero {
        padding: 5rem 1rem 2.5rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .hero-text h1 {
        font-size: 1.75rem;
    }
}
