/* --- Theme Variables --- */
:root[data-theme="dark"] {
    --bg-main: #0f172a;       /* Slate 900 */
    --bg-card: rgba(30, 41, 59, 0.85);       /* Semi-transparent Slate 800 */
    --bg-alt: transparent;        /* Solid Slate 950 */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --border-color: #334155;
}

:root[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-alt: transparent;
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e2e8f0;
}

/* --- Global Reset & Setup --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center {
    text-align: center;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-main);
    display: inline-block;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60%;
    height: 3px;
    background-color: var(--accent);
    border-radius: 2px;
}

section {
    padding: 6rem 0;
}

/* --- 3D Background --- */
#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.6; /* Lower opacity for subtle effect */
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-signature {
    font-family: 'Caveat', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    transform: rotate(-3deg);
    background: linear-gradient(90deg, var(--text-main) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.2s;
    padding-right: 8px; /* Prevents the cursive 'i' from being clipped */
}

.logo-signature:hover {
    transform: rotate(0deg) scale(1.05);
}

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

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

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-btn:hover { color: var(--text-main); }

.lang-toggle {
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.lang-toggle:hover {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px; /* Offset for navbar */
    background-color: var(--bg-alt);
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(1.8rem, 7vw, 3.5rem); /* Fluid typography */
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    letter-spacing: -1px;
}

.typewrite {
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap; /* Prevents text from breaking into a second line */
    display: inline-block;
}

.typewrite > .wrap {
    border-right: 0.08em solid var(--accent);
    animation: blink-caret .75s step-end infinite;
    color: var(--accent);
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent); }
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 550px;
}

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

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

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

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-outline:hover {
    border-color: var(--text-main);
}

.hero-image {
    flex: 0.8;
    display: flex;
    justify-content: center;
}

.profile-pic {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* --- About Section --- */
.about-section {
    background-color: var(--bg-main);
}

.about-content {
    display: flex;
    gap: 4rem;
}

.about-text {
    flex: 1.5;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-text strong {
    color: var(--text-main);
}

.skills-box {
    flex: 1;
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.skills-box h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background-color: var(--bg-main);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* --- Projects Section --- */
.projects-section {
    background-color: var(--bg-alt);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    border-color: var(--accent);
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.project-tech {
    font-family: 'Inter', sans-serif;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.project-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.project-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* --- Contact Section --- */
.contact-section {
    background-color: var(--bg-main);
    text-align: center;
}

.contact-container {
    max-width: 800px;
}

.contact-section .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.contact-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-btn {
    padding: 1rem 2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.2s;
}

.contact-btn:hover {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* --- Footer --- */
.footer {
    padding: 2rem 0;
    background-color: var(--bg-alt);
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .hero-container, .about-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-image {
        order: -1;
    }
    .hero-buttons {
        justify-content: center;
    }
    .profile-pic {
        width: 250px;
        height: 250px;
    }
    .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
}
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .nav-links { display: none; }
    .projects-grid { grid-template-columns: 1fr; }
}
