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

:root {
    --black: #0a0a0a;
    --white: #fafafa;
    --gray-50: #f7f7f7;
    --gray-100: #ededed;
    --gray-200: #e0e0e0;
    --gray-300: #c8c8c8;
    --gray-400: #a0a0a0;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #383838;
    --gray-800: #1f1f1f;
    --gray-900: #111111;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--white);
    color: var(--black);
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background: var(--black);
    color: var(--white);
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
    background: var(--black);
}

/* Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-logo img {
    width: 30px;
    height: auto; 
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-back:hover {
    color: var(--black);
}

.nav-back svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Header */
.page-header {
    padding: 8rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.page-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.page-desc {
    font-size: 1.05rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Projects Grid */
.projects-showcase {
    padding: 2rem 2rem 6rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-showcase-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--gray-200);
    margin-bottom: 3rem;
    transition: all 0.4s ease;
    background: var(--white);
}

.project-showcase-item:hover {
    border-color: var(--black);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.project-showcase-item:nth-child(even) {
    direction: rtl;
}

.project-showcase-item:nth-child(even) > * {
    direction: ltr;
}

/* Carousel */
.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
    background: var(--gray-100);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

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

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* border: 1px solid var(--gray-200);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08); */
}

.carousel-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    color: var(--gray-400);
    /* background: var(--gray-50); */
    background: #fff;
}

.carousel-placeholder svg {
    width: 48px;
    height: 48px;
    stroke: var(--gray-300);
    fill: none;
    stroke-width: 1.5;
}

.carousel-placeholder span {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Carousel Controls */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--black);
    border-color: var(--black);
}

.carousel-btn:hover svg {
    stroke: var(--white);
}

.carousel-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--black);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }

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

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot.active {
    background: var(--black);
    transform: scale(1.3);
}

.carousel-dot:hover {
    background: var(--gray-500);
}

.carousel-counter {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--white);
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    z-index: 10;
}

/* Project Info */
.project-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-info-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-300);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.project-info-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.project-info-client {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.project-info-desc {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.project-info-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.tech-tag {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.project-info-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--black);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--black);
    transition: all 0.3s ease;
    align-self: flex-start;
}

.project-info-link:hover {
    background: var(--black);
    color: var(--white);
}

.project-info-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Stats Bar */
.stats-bar {
    background: var(--black);
    color: var(--white);
    padding: 4rem 2rem;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-item-num {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.stat-item-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Footer */
.page-footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-top: 1px solid var(--gray-100);
}

/* Responsive */
@media (max-width: 1024px) {
    .project-showcase-item {
        grid-template-columns: 1fr;
    }

    .project-showcase-item:nth-child(even) {
        direction: ltr;
    }

    .carousel {
        min-height: 350px;
    }

    .carousel-slide {
        padding: 1.5rem;
    }

    .project-info {
        padding: 2rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 6rem 1.5rem 3rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .projects-showcase {
        padding: 1rem 1.5rem 4rem;
    }

    .carousel {
        min-height: 280px;
    }

    .carousel-slide {
        padding: 1rem;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
    }

    .carousel-btn.prev { left: 0.5rem; }
    .carousel-btn.next { right: 0.5rem; }

    .project-info {
        padding: 1.5rem;
    }

    .project-info-title {
        font-size: 1.4rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 3rem 1.5rem;
    }

    .stat-item-num {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .carousel {
        min-height: 220px;
    }

    .carousel-btn {
        width: 32px;
        height: 32px;
    }

    .carousel-btn svg {
        width: 14px;
        height: 14px;
    }

    .carousel-dots {
        bottom: 1rem;
        gap: 0.4rem;
    }

    .carousel-dot {
        width: 6px;
        height: 6px;
    }

    .carousel-counter {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }

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

    /* ========== DARK MODE ========== */
[data-theme="dark"] {
    --black: #fafafa;
    --white: #0a0a0a;
    --gray-50: #111111;
    --gray-100: #1a1a1a;
    --gray-200: #2a2a2a;
    --gray-300: #3a3a3a;
    --gray-400: #6a6a6a;
    --gray-500: #8a8a8a;
    --gray-600: #a0a0a0;
    --gray-700: #b5b5b5;
    --gray-800: #d0d0d0;
    --gray-900: #e5e5e5;
}

[data-theme="dark"] ::selection {
    background: var(--white);
    color: var(--black);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--gray-100);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

[data-theme="dark"] .top-nav {
    background: rgba(10, 10, 10, 0.95);
    border-bottom-color: var(--gray-800);
}

[data-theme="dark"] .nav-logo {
    filter: brightness(0) invert(1);
}

[data-theme="dark"] .nav-back {
    color: var(--gray-500);
}

[data-theme="dark"] .nav-back:hover {
    color: var(--white);
}

[data-theme="dark"] .stats-bar {
    background: var(--gray-100);
}

[data-theme="dark"] .carousel-btn {
    background: var(--gray-100);
    border-color: var(--gray-700);
}

[data-theme="dark"] .carousel-btn:hover {
    background: var(--white);
    border-color: var(--white);
}

[data-theme="dark"] .carousel-btn svg {
    stroke: var(--white);
}

[data-theme="dark"] .carousel-btn:hover svg {
    stroke: var(--black);
}

[data-theme="dark"] .carousel-dot {
    background: var(--gray-600);
}

[data-theme="dark"] .carousel-dot.active {
    background: var(--white);
}

[data-theme="dark"] .carousel-counter {
    background: var(--gray-100);
    border-color: var(--gray-700);
    color: var(--gray-400);
}

[data-theme="dark"] .carousel-placeholder {
    background: var(--gray-100);
}

[data-theme="dark"] .carousel-placeholder svg {
    stroke: var(--gray-600);
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--black);
    color: var(--white);
    border: 2px solid var(--gray-200);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
    padding: 0;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle .moon { display: block; }
.theme-toggle .sun { display: none; }

[data-theme="dark"] .theme-toggle {
    background: var(--white);
    color: var(--black);
    border-color: var(--gray-700);
}

[data-theme="dark"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }

@media (max-width: 768px) {
    .theme-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }
}

body, .project-showcase-item, .carousel, .carousel-btn, .carousel-placeholder,
.stats-bar, .top-nav, .page-footer {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


/* ========== FOOTER ========== */
footer {
    margin-left: 80px;
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-top: 1px solid var(--gray-100);
}