:root {
    --bg-light: #ffffff;
    --secondary-light: #f0f8ff;
    --accent-color: #87CEFA;
    --accent-darker: #4682B4;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Roboto', sans-serif;

    --scrollbar-track-color: rgba(224, 242, 255, 0.4);
    --scrollbar-thumb-color: rgba(135, 206, 250, 0.6);
}

/* --- Global Reset & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
    background: linear-gradient(-45deg, #ffffff, #f0f8ff, #e6f2ff, #ffffff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Layout Container --- */
.wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    /* Sidebar | Content | Profile */
    gap: 30px;
    min-height: 100vh;
    align-items: start;
}

/* --- Navbar (Left Sidebar) --- */
.nav-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
    padding: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.nav-sidebar:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
    display: block;
    font-family: var(--font-heading);
    background: linear-gradient(120deg, var(--text-primary), var(--accent-darker));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-sidebar ul {
    list-style: none;
}

.nav-sidebar ul li {
    margin-bottom: 20px;
}

.nav-sidebar ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-sidebar ul li a:hover,
.nav-sidebar ul li a.active {
    background-color: var(--secondary-light);
    color: var(--accent-darker);
    transform: translateX(5px);
}

/* --- Main Content (Middle) --- */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

section {
    background: rgba(255, 255, 255, 0.85);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

section:hover {
    transform: scale(1.01);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    position: relative;
    display: inline-block;
}

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

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1rem;
}

/* --- Hero Section --- */
#hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 248, 255, 0.95));
}

.hero-mobile-img {
    display: none;
    /* Hidden by default on desktop */
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    /* Tighter crop to show head and upper chest */
    margin: 0 auto 20px auto;
    border: 4px solid var(--accent-color);
    box-shadow: 0 10px 20px rgba(135, 206, 250, 0.3);
    animation: floatMobile 6s ease-in-out infinite;
}

.hero-text h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 10px;
    background: linear-gradient(to right, #212529, #4682B4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text h2 {
    font-size: 1.5rem;
    color: var(--accent-darker);
    margin-bottom: 25px;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 35px;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 8px 20px rgba(135, 206, 250, 0.4);
}

.btn-primary:hover {
    background-color: var(--accent-darker);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(70, 130, 180, 0.3);
}

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

.btn-outline:hover {
    background: var(--text-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(33, 37, 41, 0.15);
}

/* --- Projects Grid (Bento) --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid transparent;
    position: relative;
}

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

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

.card:hover .card-image {
    transform: scale(1.05);
}

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

.card-content h3 {
    font-size: 1.2rem;
    color: var(--accent-darker);
    margin-bottom: 10px;
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Skills & Blog Grid --- */
.skills-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.skill-item {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.skill-item img {
    width: 100%;
    object-fit: cover;
}

.blog-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.blog-card img {
    width: 100%;
    object-fit: cover;
}

.blog-title {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: var(--accent-darker);
}

/* --- Right Column (Dynamic Profile) --- */
.profile-sidebar {
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
}

.profile-img-container {
    width: 100%;
    height: 60%;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 8s ease;
    transform: scale(1);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.profile-img.active {
    opacity: 1;
    transform: scale(1.1);
}

.contact-box {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.contact-box h3 {
    margin-bottom: 15px;
    font-weight: 600;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icons a {
    color: var(--accent-darker);
    font-size: 1.5rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent-color);
    transform: scale(1.2) rotate(5deg);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 40px;
}

/* --- Animations --- */
@keyframes floatMobile {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .wrapper {
        grid-template-columns: 240px 1fr;
        /* Profile pushes to bottom or hidden first */
        max-width: 1000px;
    }

    .profile-sidebar {
        display: none;
        /* Hide sticky sidebar, move content to footer/hero */
    }

    .hero-mobile-img {
        display: block;
        /* Show in hero instead */
    }
}

@media (max-width: 900px) {
    .wrapper {
        grid-template-columns: 1fr;
        /* Single column */
        padding: 15px;
    }

    .nav-sidebar {
        position: fixed;
        bottom: 20px;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        height: auto;
        padding: 15px;
        z-index: 1000;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-sidebar:hover {
        transform: translateX(-50%) translateY(-5px);
    }

    .nav-sidebar .logo {
        display: none;
        /* Text logo takes too much space */
    }

    .nav-sidebar ul {
        display: flex;
        justify-content: space-around;
        width: 100%;
        margin: 0;
    }

    .nav-sidebar ul li {
        margin: 0;
    }

    .nav-sidebar ul li a {
        padding: 8px;
        font-size: 0.9rem;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .main-content {
        margin-bottom: 80px;
        /* Space for bottom nav */
    }

    .hero-text h1 {
        font-size: 2.2rem;
        text-align: center;
    }

    .hero-text h2 {
        text-align: center;
        font-size: 1.2rem;
    }

    .tagline {
        text-align: center;
        margin: 0 auto 30px auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }

    /* Add Author/Profile section at bottom for mobile since sidebar is gone */
    .mobile-profile-section {
        display: block;
        text-align: center;
        margin-top: 40px;
    }
}

/* --- Print Styles --- */
@media print {

    /* Reset layout */
    .wrapper {
        display: block;
        max-width: 100%;
        padding: 0;
        margin: 0;
        min-height: auto;
    }

    /* Hide sidebars and fixed elements */
    .nav-sidebar,
    .profile-sidebar {
        display: none !important;
    }

    /* Main Content */
    .main-content {
        width: 100%;
        margin: 0;
        gap: 20px;
    }

    /* Hero Section adjustments */
    #hero {
        min-height: auto;
        padding: 20px 0;
        background: none !important;
    }

    .hero-mobile-img {
        display: block !important;
        /* Show profile image in hero */
        width: 150px;
        height: 150px;
        border: none;
        box-shadow: none;
        animation: none !important;
        margin: 0 auto 20px auto;
    }

    .hero-text h1 {
        background: none !important;
        -webkit-text-fill-color: black !important;
        color: black !important;
        text-align: center;
    }

    .hero-text h2,
    .tagline {
        text-align: center;
        color: black !important;
    }

    /* Hide Action Buttons */
    .hero-actions {
        display: none !important;
    }

    /* Section styling */
    section {
        background: white !important;
        border: none;
        box-shadow: none;
        padding: 20px 0;
        margin-bottom: 30px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .section-title {
        color: black !important;
    }

    /* Grid adjustments */
    .project-grid,
    .skills-container,
    .blog-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* Two columns for better space usage */
        gap: 20px;
    }

    .card,
    .skill-item,
    .blog-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        page-break-inside: avoid;
        background: white !important;
    }

    .card-content h3 {
        color: black !important;
    }

    /* General Typography & Colors */
    body {
        background: white !important;
        color: black !important;
        font-family: serif;
        /* Better for print */
    }

    * {
        animation: none !important;
        transition: none !important;
        text-shadow: none !important;
    }

    /* Ensure links look like text or have underline */
    a {
        text-decoration: underline;
        color: black !important;
    }
}