/* --- Root Variables & Theme --- */
:root {
    --bg-dark: #030712;
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.35);
    --secondary: #818cf8;
    --accent: #c084fc;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* --- Core Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
}

/* Subtle Animated Ambient Background Grid */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12), transparent 40%),
        radial-gradient(circle at 100% 50%, rgba(129, 140, 248, 0.08), transparent 35%),
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 50px 50px, 50px 50px;
    z-index: -1;
    pointer-events: none;
}

/* --- Header & Nav --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    backdrop-filter: blur(16px);
    background: rgba(3, 7, 18, 0.75);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
}

.logo {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -1px;
}

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

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--primary);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 140px 8% 60px;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 40px;
}

.left {
    flex: 1.2;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.badge .pulse {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.left h3 {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 400;
}

.left h1 {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.1;
    margin: 8px 0;
    background: linear-gradient(135deg, #ffffff 30%, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typewriter {
    font-size: 28px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 20px;
}

.left p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.8;
    max-width: 540px;
    margin-bottom: 35px;
}

/* Hero Buttons */
.buttons {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #030712;
    border: none;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px var(--primary-glow);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Animated Profile Image */
.right {
    flex: 0.8;
    display: flex;
    justify-content: center;
}

.img-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
}

.glow-ring {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    filter: blur(35px);
    opacity: 0.5;
    animation: spin 10s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.img-wrapper img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* --- Common Sections --- */
.section {
    padding: 100px 8%;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 36px;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Glassmorphism Containers */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 40px;
}

/* --- About Section --- */
.about-box p {
    font-size: 18px;
    line-height: 2;
    color: var(--text-muted);
    text-align: center;
    max-width: 850px;
    margin: 0 auto;
}

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

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 24px 16px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.skill-card i {
    font-size: 32px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.skill-card span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.skill-card:hover i {
    transform: scale(1.15);
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .card-image img {
    transform: scale(1.08);
}

.card-content {
    padding: 28px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.card-content h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    margin-bottom: 12px;
}

.card-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 24px;
    flex-grow: 1;
}

.card-btn {
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.card-btn i {
    transition: transform 0.3s ease;
}

.project-card:hover .card-btn {
    color: var(--primary);
}

.project-card:hover .card-btn i {
    transform: translateX(5px);
}

/* --- Contact Section --- */
.form-container {
    max-width: 650px;
    margin: 0 auto;
}

.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-group textarea {
    height: 150px;
    resize: none;
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 16px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: all 0.3s ease;
}

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

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -10px;
    left: 12px;
    font-size: 12px;
    background: #0d1527;
    padding: 0 6px;
    color: var(--primary);
    border-radius: 4px;
}

.submit-btn {
    width: 100%;
    justify-content: center;
}

/* --- Footer --- */
footer {
    padding: 40px 8%;
    border-top: 1px solid var(--card-border);
    text-align: center;
    background: rgba(3, 7, 18, 0.9);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-links a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: #030712;
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-3px);
}

footer p {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 968px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .left p {
        margin: 0 auto 30px;
    }

    .buttons {
        justify-content: center;
    }

    .left h1 {
        font-size: 42px;
    }

    nav {
        display: none; /* Can be toggled with a JS hamburger menu */
    }
}