:root {
    /* Modern Minimalist Palette */
    --bg-color: #0a0a0a;
    --surface-color: #161616;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #3b82f6;
    /* Subtle blue for interactive elements */
    --accent-hover: #60a5fa;
    --border-color: #333333;

    --font-main: 'Inter', sans-serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Hide default cursor */
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--text-secondary);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Cursor Hover State */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-color);
}

/* Disable Custom Cursor on Mobile/Touch */
@media (max-width: 768px) {

    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    * {
        cursor: auto !important;
    }

    a,
    button,
    .cta-btn,
    .lang-btn {
        cursor: pointer !important;
    }
}

/* Background Particles */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    cursor: none;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

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

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

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

.lang-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--font-main);
    transition: var(--transition);
}

.lang-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Hero Section */
/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 0 var(--spacing-md);
    /* Subtle radial gradient to center focus */
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: var(--spacing-xs);
    /* Vibrant Gradient Text */
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.hero-content h2 {
    font-size: 1.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.hero-content p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-md);
    font-size: 1.1rem;
    line-height: 1.6;
}

.cta-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--accent-color), #2563eb);
    color: #fff;
    font-weight: 600;
    border-radius: 50px;
    /* Pill shape */
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-btn:hover {
    background: linear-gradient(135deg, #60a5fa, var(--accent-color));
    color: #fff;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

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

/* About Section */
.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-text p {
    margin-bottom: var(--spacing-sm);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.skill-category {
    background-color: var(--surface-color);
    padding: var(--spacing-md);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.skill-category h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.2rem;
    color: var(--text-primary);
}

.skill-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

/* Works Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-md);
}

.project-card {
    display: block;
    /* Ensure it behaves like a block for anchor tag */
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.project-media {
    height: 200px;
    background-color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    overflow: hidden;
}

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

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

.project-info {
    padding: var(--spacing-md);
}

.project-info h3 {
    margin-bottom: var(--spacing-xs);
    font-size: 1.25rem;
}

.project-info .role {
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
}

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

/* Contact Section */
.contact-content {
    text-align: center;
}

.contact-content p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 1.2rem;
}

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

/* Mobile */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-sm);
}

.gallery-item {
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    cursor: none;
    /* Handled by custom cursor */
}

.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--accent-color);
    z-index: 10;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Hidden by default */
        position: fixed;
        top: 60px;
        /* Below navbar */
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: var(--bg-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        z-index: 1000;
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex !important;
        /* Show when active */
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    /* Hamburger Animation */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

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

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

    .hamburger span {
        transition: all 0.3s ease;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    text-align: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    /* Fixed height constraint */
    min-height: 50vh;
    /* Minimum height to prevent jumping */
    object-fit: contain;
    /* Ensure full image is visible */
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto;
    animation: zoomIn 0.3s ease;
}

.lightbox-video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    outline: none;
    display: block;
    margin: 0 auto;
}

.gallery-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.gallery-item {
    position: relative;
    height: 250px;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
    filter: brightness(0.4);
}

.gallery-item:hover .gallery-video {
    transform: scale(1.05);
    filter: brightness(0.4);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Cover full height for uniform darkening if wanted, or keep bottom gradient? */
    /* User said "darken it a bit to see the on hover text". Filter on image is best. */
    /* I will keep overlay as is but maybe adjust gradient if needed. */
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    /* Slightly darker gradient */
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}


.caption-small {
    color: #ccc;
    font-weight: 300;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s;
}

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

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--accent-color);
}

.lightbox-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.control-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 5px 15px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.control-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.caption {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Pac-Man Animation */
/* Pac-Man Animation */
.pacman-container {
    width: 100%;
    max-width: 600px;
    /* Width of the track */
    height: 100px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.pacman {
    position: absolute;
    top: 50%;
    left: -60px;
    /* Start off-screen */
    width: 60px;
    height: 60px;
    margin-top: -30px;
    animation: movePacman 6s linear infinite;
    z-index: 2;
}

.pacman-top,
.pacman-bottom {
    background-color: #FFEB3B;
    /* Pacman Yellow */
    width: 100%;
    height: 50%;
    position: absolute;
    border-radius: 60px 60px 0 0;
    transform-origin: bottom center;
}

.pacman-bottom {
    top: 50%;
    border-radius: 0 0 60px 60px;
    transform-origin: top center;
}

/* Mouth Animation */
.pacman-top {
    animation: chompTop 0.3s ease-in-out infinite alternate;
}

.pacman-bottom {
    animation: chompBottom 0.3s ease-in-out infinite alternate;
}

/* Dots */
.dot {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    margin-top: -6px;
    margin-top: -6px;
    right: auto;
    /* Remove right positioning used for animation */
    /* animation: moveDots 6s linear infinite; REMOVED */
    transition: opacity 0.1s;
}

.dot.eaten {
    opacity: 0;
}

/* Lightbox Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

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

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease forwards;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease forwards;
}

.slide-out-left {
    animation: slideOutLeft 0.4s ease forwards;
}

.slide-out-right {
    animation: slideOutRight 0.4s ease forwards;
}

.lightbox-content {
    /* Ensure content is centered and relative for animations */
    position: relative;
    overflow: hidden;
    /* Hide sliding elements if they go out of bounds */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-img,
.lightbox-video {
    /* Base styles */
    transition: none;
    /* Let animation handle movement */
}

/* Total width to traverse is roughly 600px + offset */
.dot:nth-child(2) {
    animation-delay: 0s;
    left: 100px;
}

.dot:nth-child(3) {
    animation-delay: 0s;
    left: 180px;
}

.dot:nth-child(4) {
    animation-delay: 0s;
    left: 260px;
}

.dot:nth-child(5) {
    animation-delay: 0s;
    left: 340px;
}

.dot:nth-child(6) {
    animation-delay: 0s;
    left: 420px;
}

.dot:nth-child(7) {
    animation-delay: 0s;
    left: 500px;
}

.dot:nth-child(8) {
    animation-delay: 0s;
    left: 580px;
}

.dot:nth-child(9) {
    animation-delay: 0s;
    left: 660px;
}

/* Keyframes */
@keyframes chompTop {
    0% {
        transform: rotate(-45deg);
    }

    100% {
        transform: rotate(0);
    }
}

@keyframes chompBottom {
    0% {
        transform: rotate(45deg);
    }

    100% {
        transform: rotate(0);
    }
}

@keyframes movePacman {
    0% {
        left: -60px;
    }

    100% {
        left: 100%;
    }
}

/* We don't move the dots, we just hide them when pacman passes? 
   Actually, simpler approach: Pacman moves left to right.
   Dots just sit there. Better yet, let's make dots disappear as he passes.
   Wait, pure CSS 'eating' is tricky without JS or clever overlapping.
   
   Idea: The BACKGROUND is black (var(--bg-color)).
   Pacman is on top.
   The dots are there.
   Wait, if Pacman moves over them, he covers them.
   But we want them to Disappear.
   
   Alternative: The track moves left, Pacman stays inside?
   Common trick: Pacman stays center, background (dots) moves left.
   But user asked for him to "walk at the bottom".
   
   Let's stick to Pacman moving L->R.
   To make dots disappear, we can use a "mask" following pacman, or simpler:
   Just let him cover them? No, his mouth is open.
   
   Okay, simplified version: just an infinite scrolling animation where he chases.
*/

/* Revised Animation for Dots - simple static for now, he covers them mostly */
/* To sell the effect, he needs to be big enough */