@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

:root {
    --bg-dark: #0f0f11;
    --bg-light: #272727; /* Used for UI elements like pills and contact items */
    --bg-card: #161618;
    --bg-animated-light: #7d7d7d; /* New, lighter color for the background animation */
    --border-color: #2a2a2e;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent-color: #f0f0f0;
    --accent-hover: #ffffff;
    --shadow-color: rgba(240, 240, 240, 0.08);
    --header-height: 70px;
}

@keyframes animated-gradient {
	0% {
		background-position: 0% 100%;
	}
	50% {
		background-position: 50% 50%;
	}
	100% {
		background-position: 0% 100%;
	}
}
html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 0px;
}
::-webkit-scrollbar-track {
    width: 0px;
}
::-webkit-scrollbar-thumb {
    width: 0px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(45deg, var(--bg-dark), var(--bg-animated-light), #000000, var(--bg-animated-light), var(--bg-dark));
	background-size: 400% 400%;
	animation: animated-gradient 30s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

body.no-scroll {
    overflow: hidden;
}

/* --- Global & Utility --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

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

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 15, 17, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo {
    height: 35px;
    width: 35px;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.nav-link:hover::after, .nav-link.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- Hero Section --- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding-top: var(--header-height);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 1rem;
    color: var(--text-primary);
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-actions {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.hero-actions a {
    background: var(--bg-light);
    padding: 10px 22px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.hero-actions a:hover {
    color: var(--text-primary);
    border-color: var(--accent-color);
    background: var(--bg-card);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-color);
}

/* --- Main Content & Sections --- */
.main-content section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    margin: 8px auto 0;
    border-radius: 2px;
}

.section-intro {
    text-align: center;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 50px;
    font-size: 1.1rem;
}

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

.card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-color: var(--accent-color);
}

.card h3 {
    margin: 20px 20px 10px;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.card p {
    margin: 0 20px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
}

/* --- Skills --- */
.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
    justify-content: center;
}

.skills li {
    background: var(--bg-light);
    padding: 8px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: default;
}

.skills li:hover {
    color: var(--text-primary);
    border-color: var(--accent-color);
    background: var(--bg-card);
}

/* --- Contact List --- */
.contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-light);
    padding: 12px 25px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    cursor: default;
}

a.contact-item {
    cursor: pointer;
}

.contact-item:hover {
    transform: translateY(-3px);
    color: var(--text-primary);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.contact-item img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Footer --- */
.footer {
    padding: 30px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
}

/* --- Mobile Navigation Toggle --- */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

.mobile-nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Modal Styles --- */
.modal {
    display: flex; /* Use flex for centering */
    align-items: center;
    justify-content: center;
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 15, 17, 0.9);
    backdrop-filter: blur(5px);

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    padding: 30px 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 30px var(--shadow-color);
    width: 80%;
    max-width: 800px;
    max-height: 90vh; /* Allow content to be scrollable on small screens */
    overflow-y: auto;
    position: relative;
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.close-button {
    color: var(--text-secondary);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 38px;
    font-weight: bold;
    transition: color 0.3s ease;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--text-primary);
    text-decoration: none;
}

#modalBody {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

#modalTitle {
    margin-bottom: 20px;
    color: var(--text-primary);
}

#modalImage {
    max-width: 100%;
    border-radius: 8px;
}

.modal-details {
    color: var(--text-secondary);
}

.modal-details h3 {
    color: var(--text-primary);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

#modalTech {
    justify-content: flex-start;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Responsive Design --- */

@media (max-width: 992px) {
    .content {
        padding: 70px 25px 25px 25px; /* Adjust padding for toggle button */
    }

    /*
    The sidebar and toggle button styles are now the default,
    so they are no longer needed in this media query.
    */

    .card {
        flex-basis: calc(50% - 10px); /* Two cards per row */
    }
}

@media (max-width: 400px) {
    .mobile-nav-toggle {
        display: block;
    }

    .nav-menu {
        /* Keep it rendered but make it invisible for animation */
        display: flex;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px); /* Adds a subtle slide-down effect */
        transition: opacity 0.3s ease, visibility 0s 0.3s, transform 0.3s ease;

        /* Existing styles */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(15, 15, 17, 0.95);
        backdrop-filter: blur(8px);
        z-index: 999;
        align-items: center;
        justify-content: center;
    }

    .nav-menu.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition-delay: 0s; /* Ensures visibility changes instantly on open */
    }

    .nav-menu ul {
        flex-direction: column; /* Stack links vertically */
        gap: 2rem;
    }

    .nav-menu .nav-link {
        font-size: 1.5rem; /* Make links larger for easy tapping */
        color: var(--text-primary);
    }

    .card {
        flex-basis: 100%; /* One card per row */
    }

    #modalBody {
        flex-direction: column;
        align-items: stretch;
    }
}
