/* --- Variables & Reset --- */
:root {
    /* Colors */
    --color-bg: #020617;
    --color-bg-darker: #020617;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;

    --brand-50: #f0f9ff;
    --brand-400: #38bdf8;
    --brand-500: #0ea5e9;
    --brand-600: #0284c7;
    --brand-900: #0c4a6e;

    --accent: #6366f1;
    --purple: #a855f7;

    /* Additional / later variables */
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8; /* Sky Blue */
    --tag-bg: rgba(56, 189, 248, 0.1);
    --transition: all 0.3s ease;

    /* Font Families */
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Layout */
    --container-width: 80rem; /* approx 1280px (max-w-7xl) */
    --border-radius: 1rem;
}

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

html {
    scroll-behavior: smooth;
}

/* Merged body: last-defined values override earlier ones; non-conflicting props retained */
body {
    margin: 0;
    background-color: var(--bg-color);        /* from later blocks (overrides earlier color var) */
    color: var(--text-primary);               /* later value */
    font-family: 'Poppins', sans-serif;      /* later overrides earlier font */
    line-height: 1.6;                         /* later overrides earlier line-height */
    overflow-x: hidden;                       /* retained from earlier definition */
    -webkit-font-smoothing: antialiased;      /* retained from earlier */
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition); /* last-defined transition used */
}

/* Base elements */
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- Utilities --- */
.container {
    max-width: 1200px;     /* last-defined value */
    margin: 0 auto;
    padding: 0 20px;       /* last-defined value */
}

.container-narrow {
    max-width: 56rem; /* max-w-4xl */
}

.text-brand { color: var(--accent-color); } /* last-defined value */
.text-purple { color: #c084fc; }
.text-white { color: #fff; }
.text-gray { color: var(--color-text-muted); }

.font-semibold { font-weight: 600; }
.text-lg { font-size: 1.125rem; }
.text-center { text-align: center; }
.mt-12 { margin-top: 3rem; }
.mb-8 { margin-bottom: 2rem; }
.hidden { display: none; }

/* Icon Colors */
.text-orange { color: #f97316; }
.text-blue { color: #3b82f6; }
.text-yellow { color: #eab308; }
.text-sky { color: #0ea5e9; }
.text-yellow-light { color: #fde047; }
.text-red { color: #ef4444; }
.text-red-light { color: #f87171; }
.text-green { color: #22c55e; }

/* --- Components --- */

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--brand-600);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.2);
}
.btn-primary:hover {
    background-color: var(--brand-500);
}

.btn-outline {
    border: 1px solid #4b5563;
    color: #cbd5e1;
    background: transparent;
}
.btn-outline:hover {
    border-color: var(--brand-400);
    color: var(--brand-400);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-weight: 600;
}

.btn-block {
    width: 100%;
    font-weight: 700;
}

/* Glassmorphism: final merged .glass-card (later definitions win where conflicting) */
.glass-nav {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card {
    background: var(--card-bg);                       /* last-defined */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    position: relative; /* retained from one of later definitions */
}
.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); /* last-defined */
    border-color: rgba(56, 189, 248, 0.3);
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(to right, var(--brand-400), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #020617; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --- Navbar --- */
.navbar {
    position: fixed;
    width: 100%;
    z-index: 50;
    transition: all 0.3s;
    padding: 1rem 0;
}
.navbar.scrolled {
    padding: 0.5rem 0;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 2.5rem;
}
.logo a {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: white;
}
.nav-links-desktop {
    display: none;
    align-items: baseline;
    gap: 2rem;
}
.nav-links-desktop a {
    font-size: 0.875rem;
    font-weight: 500;
}
.nav-links-desktop a:hover {
    color: var(--brand-400);
}
.nav-toggle {
    display: block;
}
#mobile-menu-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
}
#mobile-menu-btn:hover { color: white; }

/* Mobile Menu */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    border-top: 1px solid #1f2937;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(12px);
}
.mobile-menu-content {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.mobile-menu-content a {
    color: #d1d5db;
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}
.mobile-menu-content a:hover {
    color: white;
    background-color: rgba(255,255,255,0.05);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}
.overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #020617, transparent, #020617);
}
.overlay-solid {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
}

/* Blobs */
.blob {
    position: absolute;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    mix-blend-mode: multiply;
    animation: blob 7s infinite;
    top: 0;
}
.blob-purple {
    left: -1rem;
    background-color: #a855f7;
}
.blob-brand {
    right: -1rem;
    background-color: var(--brand-500);
}
.hero-content {
    position: relative;
    z-index: 10;
}
.hero-subtitle {
    color: var(--brand-400);
    font-family: var(--font-mono);
    margin-bottom: 1rem;
}
.hero-title {
    font-size: 3rem; /* default; adjusted in media query */
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}
.typing-container {
    height: 2rem;
    margin-bottom: 2rem;
}
.typing-text {
    font-size: 1.25rem;
    font-family: var(--font-mono);
    color: #d1d5db;
}
.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}
.social-links {
    display: flex;
    gap: 20px;         /* last-defined */
    margin-top: 20px;  /* last-defined */
    justify-content: center;
}
.social-links a {
    font-size: 1.8rem;           /* last-defined */
    color: var(--text-secondary); /* last-defined */
    transition: var(--transition);
}
.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #6b7280;
    animation: bounce 1s infinite;
}

/* --- About Section --- */
.section {
    padding: 80px 0; /* last-defined value */
    position: relative;
}
.bg-darker {
    background-color: rgba(2, 6, 23, 0.5);
}
.about-grid {
    display: grid;
    gap: 3rem;
    align-items: center;
}
.about-image-wrapper {
    position: relative;
}
.glow-effect {
    position: absolute;
    inset: -0.25rem;
    background: linear-gradient(to right, var(--brand-600), #9333ea);
    border-radius: 1rem;
    filter: blur(16px);
    opacity: 0.25;
    transition: opacity 1s;
}
.about-image-wrapper:hover .glow-effect {
    opacity: 0.75;
    transition: opacity 0.2s;
}
.about-img {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
}
.about-img img {
    transition: transform 0.5s;
}
.about-image-wrapper:hover img {
    transform: scale(1.05);
}
.section-title {
    font-size: 2.5rem; /* last-defined */
    font-weight: 700;
    margin-bottom: 10px; /* last-defined */
}
.highlight-underline {
    border-bottom: 4px solid var(--brand-500);
    padding-bottom: 0.25rem;
}
.section-subtitle {
    color: var(--text-secondary); /* last-defined */
    max-width: 42rem;            /* retained from earlier */
    margin: 0 auto;
    font-size: 1.1rem;           /* last-defined */
}
.section-header {
    text-indent: center;  /* retained (typo preserved as in original) */
    text-align: center;    /* last-defined */
    margin-bottom: 60px;   /* last-defined */
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.stat-card {
    padding: 1rem;
    text-align: center;
    border-radius: 0.5rem;
}
.stat-card h3 {
    font-size: 1.875rem;
    font-weight: 700;
}
.stat-card p {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Skills Grid */
.skills-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.skill-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 6px 18px rgba(2,6,23,0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    min-height: 68px;
}
.skill-card i { font-size: 1.25rem; }

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* last-defined */
    gap: 30px; /* last-defined */
}
.project-card {
    border-radius: 1rem;
    overflow: hidden;
}
.project-img-wrapper {
    position: relative;
    height: 200px; /* last-defined */
    overflow: hidden;
}
.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.glass-card:hover .project-img-wrapper img,
.project-card:hover .project-img-wrapper img {
    transform: scale(1.1);
}

/* Merged project overlay and hover behavior (last definitions win where conflicting) */
.project-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8); /* last-defined */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Hidden by default */
    transition: var(--transition);
    z-index: 2;
}
.glass-card:hover .project-overlay,
.project-card:hover .project-overlay {
    opacity: 1; /* Show on hover */
}
.project-overlay a {
    color: var(--text-primary); /* last-defined */
    font-size: 1.5rem;
    background: rgba(255,255,255,0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-overlay a:hover {
    color: var(--accent-color);
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.project-content {
    padding: 25px; /* last-defined */
    position: relative;
    z-index: 3;
    background: transparent;
}
.project-content h3 {
    margin: 0 0 10px;     /* last-defined */
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary); /* last-defined */
    transition: color 0.3s;     /* retained from earlier */
}
.project-card:hover .project-content h3 {
    color: var(--brand-400);
}
.project-content p {
    color: var(--text-secondary); /* last-defined */
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* last-defined */
}
.tag {
    font-size: 0.75rem;
    padding: 5px 12px; /* last-defined */
    border-radius: 20px;
    background: var(--tag-bg); /* last-defined */
    color: var(--accent-color); /* last-defined */
    font-weight: 500;
    border: none; /* earlier tag had border; last-defined removed it — we keep no border */
}

.view-more-link {
    display: inline-flex;
    align-items: center;
    color: var(--brand-400);
    font-weight: 500;
}
.view-more-link:hover { color: white; }
.view-more-link i { margin-left: 0.5rem; }

/* --- Contact / Education / Certifications merged styles --- */

/* Contact-specific container & layout */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}
.contact-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.contact-details {
    margin-top: 30px;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-primary);
}
.contact-item i { font-size: 1.2rem; }

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(15, 23, 42, 0.8);
}
.contact-form button {
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--accent-color), #0ea5e9);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.contact-form button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Footer (merged from later definitions) */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 40px;
    font-size: 0.9rem;
}

/* Utility / Animations merged */
.reveal-on-scroll {
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.6s ease; /* last-defined */
}

/* Delay utilities: keep both transition-delay and animation-delay where present */
.delay-100 { transition-delay: 0.1s; animation-delay: 100ms; }
.delay-200 { transition-delay: 0.2s; animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

.delay-blob { animation-delay: 2000ms; }

/* --- Animations --- */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes blink { 50% { opacity: 0; } }
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(-25%) translateX(-50%); animation-timing-function: cubic-bezier(0.8,0,1,1); }
    50% { transform: translateY(0) translateX(-50%); animation-timing-function: cubic-bezier(0,0,0.2,1); }
}

/* --- Media Queries (Responsiveness) --- */
@media (min-width: 640px) {
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-buttons { flex-direction: row; }
}

@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .nav-links-desktop { display: flex; }

    .hero-title { font-size: 4.5rem; }
    .typing-container { height: 3rem; }
    .typing-text { font-size: 1.875rem; }

    .about-grid { grid-template-columns: repeat(2, 1fr); }

    .skills-grid { grid-template-columns: repeat(4, 1fr); }

    .projects-grid { grid-template-columns: repeat(2, 1fr); }

    .contact-card { padding: 3rem; }
    .form-row { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .skills-grid { grid-template-columns: repeat(6, 1fr); }
    .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile responsiveness blocks merged (last values retained) */
@media (max-width: 768px) {
    .section { padding: 60px 0; }
    .section-title { font-size: 2rem; }
    .projects-grid { grid-template-columns: 1fr; }

    /* Stack the contact grid on mobile */
    .contact-content {
        grid-template-columns: 1fr;
        padding: 25px;
        gap: 30px;
    }
}