/* ============================================
   1. BASE (Reset + Variables)
   ============================================ */

:root {
    --primary: #6c63ff;
    --secondary: #2d2d3f;
    --background: #0f0f1a;
    --surface: #1a1a2e;
    --text: #ffffff;
    --text-muted: #a0a0b8;
    --border: #2d2d4f;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: #8b83ff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

/* ============================================
   2. LAYOUT
   ============================================ */

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

/* ============================================
   3. COMPONENTS
   ============================================ */

header {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.logo a:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
}

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

.nav-links a:hover {
    color: var(--text);
}

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

section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 50px 40px;
    margin-bottom: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text);
    position: relative;
}

section h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin-top: 8px;
    border-radius: 4px;
}

#home {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, var(--surface) 0%, #1a1a3e 100%);
}

#home h1 {
    font-size: 3rem;
    margin-bottom: 16px;
}

#home h1 span {
    color: var(--primary);
}

#home p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 24px;
}

#home .btn {
    font-size: 1.1rem;
    padding: 14px 36px;
}

.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.about-content img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    flex-shrink: 0;
}

.about-content p {
    color: var(--text-muted);
    margin-bottom: 12px;
}

#skills ul {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    list-style: none;
}

#skills ul li {
    background: rgba(108, 99, 255, 0.15);
    color: var(--primary);
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid rgba(108, 99, 255, 0.2);
    transition: var(--transition);
}

#skills ul li:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

/* Project Cards - Hover Effect Upgrade */
.project-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Glow Effect on Hover */
.project-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(108, 99, 255, 0.1) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.6s;
    pointer-events: none;
}

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

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(108, 99, 255, 0.2);
}

/* Project Links - Better Styling */
.project-card a {
    display: inline-block;
    margin-right: 16px;
    margin-top: 8px;
    padding: 6px 18px;
    border-radius: 50px;
    background: rgba(108, 99, 255, 0.1);
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.project-card a:hover {
    background: var(--primary);
    color: white;
}

/* ---------- CONTACT FORM (IMPROVED) ---------- */
form {
    max-width: 500px;
}

form div {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-muted);
}

/* Input fields - Clean and Professional */
input,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    /* DEFAULT BORDER - Important for JavaScript */
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

/* Focus state */
input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

/* JavaScript validation classes (optional) */
input.error,
textarea.error {
    border-color: #ff4757 !important;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2);
}

input.success,
textarea.success {
    border-color: #2ed573 !important;
    box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.2);
}

textarea {
    resize: vertical;
}

button[type="submit"] {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

footer div {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
}

footer a {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--primary);
}

/* ============================================
   4. MOBILE FIRST (Responsive)
   ============================================ */

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    section {
        padding: 30px 20px;
    }

    #home h1 {
        font-size: 2.2rem;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-content img {
        width: 150px;
        height: 150px;
    }

    .nav-links {
        gap: 16px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    nav {
        flex-direction: column;
        gap: 12px;
    }

    .nav-links {
        justify-content: center;
        gap: 12px;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    #home h1 {
        font-size: 1.8rem;
    }

    #home p {
        font-size: 1rem;
    }

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

    section h2 {
        font-size: 1.6rem;
    }
}
