:root {
    /* DARK MODE (Default) */
    --bg-primary: #0a0a0c;
    --bg-secondary: #121216;
    --bg-tertiary: #1c1c24;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    /* Increased brightness for better contrast */
    --text-tertiary: #94a3b8;

    /* Vibrant Accent Colors */
    --accent: #6366f1;
    /* Indigo-500: More vibrant than previous blue */
    --accent-glow: rgba(99, 102, 241, 0.5);
    --accent-dark: #4f46e5;

    --border-color: rgba(255, 255, 255, 0.15);

    --card-bg: rgba(30, 41, 59, 0.5);
    /* Glassy look */
    --nav-bg: rgba(10, 10, 12, 0.8);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;

    --container-width: 1200px;
    --header-height: 80px;

    /* Gradients & Surfaces */
    --gradient-start: #ffffff;
    --gradient-end: #94a3b8;
    --surface-hover: rgba(255, 255, 255, 0.05);
}

/* LIGHT MODE OVERRIDES */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;

    --accent: #4f46e5;
    /* Slightly darker for float on light bg */
    --accent-glow: rgba(79, 70, 229, 0.3);
    --accent-dark: #4338ca;

    --border-color: rgba(15, 23, 42, 0.1);

    --card-bg: rgba(255, 255, 255, 0.8);
    --nav-bg: rgba(255, 255, 255, 0.9);

    /* Light Mode Gradients & Surfaces */
    --gradient-start: #334155;
    --gradient-end: #6366f1;
    /* Dark Grey to Indigo */
    --surface-hover: rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    h3 {
        font-size: 1.5rem !important;
    }

    section {
        padding: 4rem 0;
    }
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

button {
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    outline: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    :root {
        --header-height: 70px;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-gradient {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-accent {
    color: var(--accent);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 30px var(--accent-glow);
}

.btn-outline {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

/* Navbar specific styles */
nav {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Class added via JS on scroll */
nav.scrolled {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.5rem;
    z-index: 1001;
}

.logo img {
    height: 40px;
}

.desktop-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.mobile-toggle {
    display: none;
    background: transparent;
    color: var(--text-primary);
    z-index: 1001;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 1000;

    /* Animation state: hidden by default */
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.mobile-menu.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .desktop-menu {
        display: none !important;
    }

    .mobile-toggle {
        display: block !important;
    }

    .mobile-menu {
        width: 100%;
        padding: 2rem;
        background: var(--nav-bg);
        backdrop-filter: blur(20px);
    }
}

/* Footer specific styles */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
    padding-bottom: 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* Layout helpers */
section {
    padding: 6rem 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- ANIMATIONS & EFFECTS --- */

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Utility Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delays */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

/* Enhanced Card Styles */
.card-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-glow);
}

.card-hover:hover h2,
.card-hover:hover h3 {
    color: var(--accent);
    transition: color 0.3s ease;
}

/* Hero Badge Pulse */
.hero-badge {
    animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    display: block;
}

/* Feed Grid Layout */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feed-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 280px;
    /* Square-ish aspect ratio */
    position: relative;
    transition: all 0.4s ease;
}

.feed-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-glow);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.feed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.feed-icon-box {
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--surface-hover);
}

.feed-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--surface-hover);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.feed-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.35;
    font-weight: 700;
    /* Limit lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    /* Limit lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom Checkbox Style for Form */
.skill-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: var(--bg-tertiary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.skill-checkbox:hover {
    border-color: var(--accent);
}

.skill-checkbox input {
    accent-color: var(--accent);
}

.feed-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}