:root {
    /* Colors */
    --bg-dark: #222831;
    --bg-card: #393E46;
    --text-main: #EEEEEE;
    --text-muted: #b0b0b0;
    --accent: #00ADB5;
    --accent-glow: rgba(0, 173, 181, 0.3);
    --border: rgba(238, 238, 238, 0.1);

    /* Typography */
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;
}

[data-theme="light"] {
    --bg-dark: #f0f2f5;
    --bg-card: #ffffff;
    --text-main: #222831;
    --text-muted: #555555;
    --accent: #00ADB5;
    --accent-glow: rgba(0, 173, 181, 0.15);
    --border: rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 173, 181, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 173, 181, 0.05) 0%, transparent 25%);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

ul {
    list-style: none;
}

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

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

/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
    text-align: center;
}

.loader-text {
    font-family: var(--font-mono);
    color: var(--accent);
    letter-spacing: 5px;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: block;
}

.loader-bar {
    width: 200px;
    height: 2px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}

.loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: var(--accent);
    animation: load 1.5s infinite ease-in-out;
}

@keyframes load {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

/* --- Header --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 15, 17, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

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

.logo a {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}

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

.desktop-nav ul {
    display: flex;
    gap: 2.5rem;
}

.desktop-nav a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.desktop-nav a:hover {
    color: var(--accent);
}

.theme-toggle {
    background: #4a4a4a;
    border: none;
    width: 60px;
    height: 30px;
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease;
    padding: 0;
    margin-left: 2rem;
}

.theme-toggle:hover {
    background: #5a5a5a;
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .toggle-slider {
    transform: translateX(30px);
}

[data-theme="light"] .theme-toggle {
    background: #e0e0e0;
}

[data-theme="light"] .theme-toggle:hover {
    background: #d0d0d0;
}

/* --- Mobile Menu --- */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--bg-dark);
    padding: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu ul {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mobile-menu a {
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 600;
}

.mobile-menu a:hover {
    color: var(--accent);
}

.mobile-toggle {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.mobile-toggle span {
    width: 30px;
    height: 2px;
    background: #fff;
    transition: 0.3s;
}

/* Hamburger animation when active */
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

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

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    overflow: hidden;
}

/* Animated Background Shapes */
.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow), transparent);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 173, 181, 0.15), transparent);
    top: 60%;
    right: 10%;
    animation-delay: -7s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 173, 181, 0.1), transparent);
    bottom: 20%;
    left: 50%;
    animation-delay: -14s;
}

.shape-4 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(0, 173, 181, 0.12), transparent);
    top: 40%;
    right: 30%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    75% {
        transform: translate(20px, 30px) scale(1.05);
    }
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-greeting {
    font-family: var(--font-mono);
    color: var(--accent);
    margin-bottom: 0rem;
    display: block;
    font-size: 1.2rem;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.hero-title {
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 0rem;
    background: linear-gradient(120deg, #fff 0%, var(--accent) 50%, #fff 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

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

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

.cursor {
    display: inline-block;
    background: var(--accent);
    width: 3px;
    margin-left: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 600px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-desc {
    animation: fadeInUp 1s ease-out 0.5s both;
}

.hero-cta {
    animation: fadeInUp 1s ease-out 0.7s both;
}

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

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

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--accent);
    z-index: -1;
    transition: 0.4s ease;
}

.btn:hover {
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.btn:hover::before {
    width: 100%;
}

.btn:active {
    transform: translateY(-1px);
}

.btn-outline:hover {
    color: var(--bg-dark) !important;
    background: var(--text-muted);
}

/* --- Section General --- */
section {
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::after {
    content: '';
    height: 1px;
    background: var(--border);
    flex-grow: 1;
    max-width: 300px;
}

.section-number {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 400;
}

/* --- About & Skills --- */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* About Image Styles */
.about-image {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
}

.about-image-wrapper {
    position: relative;
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
}

.profile-pic {
    width: 100%;
    height: auto;
    border-radius: 4px;
    position: relative;
    z-index: 2;
    filter: grayscale(100%) contrast(1.1);
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    display: block;
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
}

.image-border {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 4px;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.about-image-wrapper:hover .profile-pic {
    filter: none;
    transform: translate(-5px, -5px);
    box-shadow: 0 20px 30px -15px rgba(2, 12, 27, 0.7);
}

.about-image-wrapper:hover .image-border {
    transform: translate(5px, 5px);
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.skill-item i {
    color: var(--accent);
}

/* --- Experience --- */
.timeline {
    border-left: 2px solid var(--border);
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 5px;
    width: 1rem;
    height: 1rem;
    background: var(--bg-dark);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.timeline-year {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-role {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.timeline-company {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 600;
}

.timeline-desc {
    color: var(--text-muted);
}

/* --- My Skills Section --- */
.skills-section {
    background: linear-gradient(135deg, rgba(0, 173, 181, 0.03) 0%, transparent 50%);
}

.skills-intro {
    text-align: center;
    color: var(--text-muted);
    max-width: 700px;
    margin: -2rem auto 3rem;
    font-size: 1.05rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.skill-bar-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease,
        border-color 0.3s ease;
}

.skill-bar-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.skill-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skill-bar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.skill-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.skill-percentage {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 700;
}

.skill-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.skill-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #00d4dd 100%);
    border-radius: 10px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px var(--accent-glow);
}

.skill-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* --- Portfolio --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.3s ease, box-shadow 0.4s ease;
    border: 1px solid transparent;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 20px 30px rgba(0, 173, 181, 0.2), 0 0 10px var(--accent-glow);
}

.project-image {
    height: 200px;
    background: #2a2a30;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.project-content {
    padding: 2rem;
}

.project-cat {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* .project-title {
    font-size: 1.5rem;
    color: blue;
    margin-bottom: 1rem;
} */

.project-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 0.9rem;
}

.project-link:hover {
    color: var(--accent);
}

/* --- Contact --- */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    margin-bottom: 3rem;
    color: var(--text-muted);
}

/* --- Footer --- */
#main-footer {
    padding: 3rem 0;
    box-shadow: 0 20px 30px rgba(0, 173, 181, 0.2), 0 0 10px var(--accent-glow);
}

.project-image {
    height: 200px;
    background: #2a2a30;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.project-content {
    padding: 2rem;
}

.project-cat {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: block;
}

.project-title {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 0.9rem;
}

.project-link:hover {
    color: var(--accent);
}

/* --- Contact --- */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    margin-bottom: 3rem;
    color: var(--text-muted);
}

/* --- Footer --- */
#main-footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer-social {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-social a {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.footer-social a:hover {
    color: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 3rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-me {
        margin-left: 0rem !important;
    }
}

/* --- Project Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-card);
    margin: auto;
    padding: 0;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(50px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

.close-modal {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover,
.close-modal:focus {
    color: #fff;
    background: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
        min-height: 500px;
        height: auto;
    }

    .modal-image-container {
        flex: 1.5;
        height: 100%;
    }

    .modal-info {
        flex: 1;
        padding: 3rem;
        overflow-y: auto;
    }
}

/* Carousel */
.modal-image-container {
    background: #000;
    position: relative;
    min-height: 300px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    /* Prevent it from being too tall on large screens */
    object-fit: contain;
    background: #1a1a1a;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    z-index: 5;
    transition: 0.3s;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: var(--accent);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.dot.active {
    background: var(--accent);
    transform: scale(1.2);
}

/* Modal Info */
.modal-info {
    padding: 2rem;
    background: var(--bg-card);
}

.modal-category {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.modal-title {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.modal-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.modal-desc {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

.modal-link {
    width: 100%;
    text-align: center;
}

/* View Project Button override */
.view-project-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: var(--font-main);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: 0.3s;
}

.view-project-btn:hover {
    color: var(--accent);
}