/* =========================
   RESET + BASE
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #0f0f0f;
    color: #f5f5f5;
    line-height: 1.6;
}
a {
    color: inherit;
    text-decoration: none;
}

a:visited {
    color: inherit;
}

/* =========================
   Z-INDEX SCALE (single source of truth)
========================= */
:root {
    --z-navbar: 1000;
    --z-menu-toggle: 1001;
    --z-nav-links: 999;
    --z-dropdown: 1002;
    --z-carousel-fade: 15;
    --z-carousel-btn: 20;
    --accent: #7f5af0;
    --accent-light: #9d79ff;
    --bg: #0f0f0f;
    --bg-elevated: #1a1a1a;
}

/* =========================
   NAVBAR
========================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    line-height: 80px;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15,15,15,0.9);
    backdrop-filter: blur(10px);
    z-index: var(--z-navbar);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    z-index: var(--z-nav-links);
}

.nav-links a {
    color: #f5f5f5;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* =========================
   HERO
========================= */
.hero {
    height: 90vh;
    display: flex;
    align-items: center;
    padding: 3rem;
    background: url('assets/moon-background.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(15,15,15,0.75) 0%, rgba(15,15,15,0.35) 55%, rgba(15,15,15,0.1) 100%);
    z-index: 1;
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.hero p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: #cccccc;
}

/* =========================
   BUTTONS
========================= */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

/* =========================
   SECTIONS
========================= */
.section,
.project-page {
    padding: calc(80px + 3rem) 3rem 5rem;
    max-width: 1000px;
    margin: auto;
}

.section-title {
    margin-bottom: 2.5rem;
    font-size: 2rem;
}

/* =========================
   ABOUT
========================= */
.about-section h2 {
    font-size: 2.5rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 3rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
}

.about-text h3:not(:first-child) {
    margin-top: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    color: #cccccc;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-image img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

@media (min-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =========================
   PROJECT GRID + CARDS
========================= */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .project-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.project-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: block;
    text-decoration: none;
    color: white;
    background: var(--bg-elevated);
}

.project-card img {
    width: 100%;
    height: clamp(220px, 40vw, 390px);
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
    -webkit-user-drag: none;
    user-select: none;
}

.project-overlay {
    position: absolute;
    inset: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.55), rgba(0,0,0,0.1));
}

.project-overlay h3 {
    font-size: 1.8rem;
    margin-bottom: 0.6rem;
}

.project-overlay p {
    font-size: 1rem;
    color: #d0d0d0;
    margin-bottom: 0.8rem;
}

.tech {
    font-size: 0.9rem;
    color: var(--accent);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.project-card:hover img {
    transform: scale(1.08);
}

/* =========================
   CAROUSEL
========================= */
.project-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 3rem;
}

.project-scroll-wrapper::before,
.project-scroll-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: var(--z-carousel-fade);
    pointer-events: none;
}

.project-scroll-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg) 20%, transparent);
}

.project-scroll-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg) 20%, transparent);
}

.project-scroll {
    display: flex;
    gap: 2rem;
    width: max-content;
    will-change: transform;
    cursor: grab;
}

.project-scroll.dragging {
    cursor: grabbing;
}

.project-scroll .project-card {
    flex: 0 0 auto;
    width: clamp(280px, 40vw, 420px);
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
    z-index: var(--z-carousel-btn);
    backdrop-filter: blur(8px);
    background: rgba(20,20,20,0.7);
    color: #f5f5f5;
}

.scroll-btn.left { left: 1rem; }
.scroll-btn.right { right: 1rem; }

.scroll-btn:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

/* progress dots */
.scroll-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.75rem;
}

.scroll-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    border: none;
    padding: 0;
}

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

/* =========================
   DROPDOWN
========================= */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-elevated);
    min-width: 220px;
    max-width: 260px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: var(--z-dropdown);
}

.dropdown-content a {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    line-height: 1.3;
    color: #f5f5f5;
    white-space: normal;
    transition: background 0.25s ease, color 0.25s ease;
}

.dropdown-content a:hover {
    background: var(--accent);
    color: #fff;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* =========================
   CONTACT
========================= */
#contact {
    background: var(--bg-elevated);
    padding: 6rem 2rem;
    text-align: center;
    border-radius: 16px;
    max-width: 800px;
    margin: 4rem auto;
}

#contact h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

#contact > p:first-of-type {
    color: #cccccc;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-links a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.6rem;
    background: #2c2c2c;
    border-radius: 12px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.email-link {
    color: var(--accent);
    font-weight: 500;
}

.email-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.contact-links a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.contact-links a img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

footer {
    text-align: center;
    padding: 2rem 0 3rem;
    color: #777;
    font-size: 0.9rem;
}

/* =========================
   SCROLLBAR
========================= */
::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

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

/* =========================
   MOBILE NAV
========================= */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: var(--z-menu-toggle);
    position: relative;
    user-select: none;
}

.mobile-banner {
    display: none;
}

@media (max-width: 768px) {

    .mobile-banner {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #111;
        color: white;
        text-align: center;
        padding: 10px;
        font-size: 0.9rem;
        z-index: 1000;
    }

    .menu-toggle {
        display: block;
    }

    .navbar {
        height: 70px;
        line-height: 70px;
        padding: 0 1.5rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        right: 0;
        width: 100%;
        background: rgba(15,15,15,0.98);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
    }

    .nav-links.active {
        display: flex;
    }

    .hero {
        height: auto;
        padding: 6rem 1.5rem 3rem;
        text-align: center;
    }

    body {
        padding-bottom: 50px;
    }

    .project-overlay {
        position: relative;
        background: rgba(0,0,0,0.85);
    }

    .project-scroll-wrapper::before,
    .project-scroll-wrapper::after {
        width: 40px;
    }

    .project-scroll-wrapper {
        padding: 0 1rem;
    }
}