/* Variables & reset */
:root {
    --card: #ffffff;
    --primary: #6366f1;
    --secondary: #22c55e;
    --accent: #ec4899;
    --text: #0f172a;
    --muted: #475569;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: linear-gradient(180deg, #f8fafc, #eef2ff);
    color: var(--text);
    line-height: 1.6;
}

a {
    position: relative;
    color: var(--primary);
    text-decoration: double;
}

a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0%;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* Particles */
#particles {
    position: fixed;
    inset: 0;
    z-index: -1;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.85);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 100;
}

.nav-left {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-right a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
}

.nav-right a:hover {
    color: var(--primary);
}

#themeToggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Hero */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
}

.typing-text {
    font-family: 'Parisienne', cursive;
    font-size: 3.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.tagline {
    max-width: 620px;
    font-size: 1.05rem;
    color: var(--muted);
    margin-bottom: 2.2rem;
}

.resume-btn {
    padding: 0.75rem 1.8rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99,102,241,0.35);
}

/* General */
.container {
    max-width: 960px;
    margin: auto;
    padding: 4rem 1.5rem;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
    position: relative;
}

h2::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin-top: 0.4rem;
    border-radius: 2px;
}

p {
    margin-bottom: 2rem;
    color: var(--muted);
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.8rem;
    margin-bottom: 4rem;
}

.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1.6rem;
    border-radius: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(99,102,241,0.15);
}

.project-card h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.4rem;
}

.project-card a {
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
}

.project-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
    margin: 0.5rem 0;
    font-weight: 400;
}

.project-tech {
    font-size: 0.72rem;
    color: #999;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.project-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #e8e5e0;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img {
    transform: scale(1.02);
}

/* Skills */
.skill-list {
    list-style: none;
    margin-bottom: 4rem;
}

.skill-list li {
    padding: 0.7rem 0;
    border-bottom: 1px dashed var(--border);
    color: var(--muted);
}

/* Contact */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-form input,
.contact-form textarea {
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.contact-form button {
    align-self: flex-start;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.contact-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99,102,241,0.35);
}

.contact-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.contact-form button:active {
    transform: translateY(0);
    box-shadow: none;
}

.message.success { color: var(--secondary); }
.message.error { color: #ef4444; }

.contact-line {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.contact-row a {
    text-decoration: none;
    color: var(--primary);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
}

.contact-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.7s ease forwards;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dark mode */
body.dark {
    --card: #020617;
    --primary: #818cf8;
    --secondary: #4ade80;
    --accent: #f472b6;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #1e293b;
    background: radial-gradient(circle at top, #020617, #020617);
}

body.dark .navbar {
    background: rgba(2,6,23,0.8);
}

body.dark .project-card {
    background: linear-gradient(180deg, #020617, #020617);
}

body.dark .contact-form {
    background: rgba(2,6,23,0.6);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #1e293b;
}

body.dark .contact-form input,
body.dark .contact-form textarea {
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #1e293b;
}

body.dark .contact-form input::placeholder,
body.dark .contact-form textarea::placeholder {
    color: #94a3b8;
}

body.dark .contact-form button {
    background: var(--primary);
    color: #020617;
}

body.dark .contact-form button:hover {
    box-shadow: 0 8px 22px rgba(129,140,248,0.35);
}

body.dark .contact-form input:focus,
body.dark .contact-form textarea:focus {
    border-color: var(--primary);
}

body.dark .wa-badge img {
    filter: invert(1) brightness(0.9);
}

/* Mobile */
@media (max-width: 600px) {
    .navbar {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 14px 16px !important;
        margin: 0 !important;
        left: 0 !important;
        right: 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    .nav-right {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .nav-right a {
        margin-left: 10px !important;
        font-size: 0.9rem !important;
        white-space: nowrap;
    }

    #themeToggle {
        flex-shrink: 0;
        font-size: 1rem;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 18px !important;
        margin: 0 auto !important;
        box-sizing: border-box;
    }

    .hero {
        padding: 50px 10px !important;
        margin-top: 20px !important;
    }

    .typing-text {
        font-size: 1.8rem !important;
        line-height: 2.3rem !important;
    }

    .hero::before {
        width: 260px !important;
        height: 260px !important;
        filter: blur(70px) !important;
    }
}

/* Dark mode contact icon fix */
body.dark .contact-icon img[src*="whatsapp"] {
    filter: invert(1) brightness(0.9);
}

body.dark .contact-icon img[src*="gitfav"] {
    filter: invert(1);
}

/* Space before footer */
.contact-line {
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .nav-left {
        margin-left: 5px;
    }
}