:root {
    --bg-color: #0d0d11;
    --card-bg: #16161e;
    --primary-color: #0088ff;
    /* Electric Blue */
    --accent-color: #00ff9d;
    /* Neon Green (Kept for contrast) */
    --text-color: #e0e0e0;
    --text-muted: #8b9bb4;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Rajdhani', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    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: 5px;
    height: 5px;
    background-color: var(--accent-color);
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 1px solid var(--accent-color);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(13, 13, 17, 0.8);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo .accent {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 2rem;
}

.lang-switch span {
    color: var(--text-muted);
    user-select: none;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
}

.lang-btn:hover {
    color: var(--accent-color);
}

.lang-btn.active {
    color: var(--accent-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
}

/* Background grid effect */
.hero::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200px;
    top: -50%;
    left: -50%;
    background-image:
        linear-gradient(rgba(0, 136, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 136, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    z-index: -1;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

.hero-content {
    max-width: 600px;
    z-index: 10;
}

.hero .subtitle {
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.hero .highlight {
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(0, 136, 255, 0.4);
}

.hero h2.role {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    color: #ff00c1;
    z-index: -1;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(-2px, -2px);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch::after {
    color: #00fff9;
    z-index: -2;
    clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
    transform: translate(2px, 2px);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
    }

    20% {
        clip-path: inset(60% 0 1% 0);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
    }

    80% {
        clip-path: inset(10% 0 70% 0);
    }

    100% {
        clip-path: inset(30% 0 20% 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
    }

    20% {
        clip-path: inset(30% 0 20% 0);
    }

    40% {
        clip-path: inset(70% 0 10% 0);
    }

    60% {
        clip-path: inset(20% 0 50% 0);
    }

    80% {
        clip-path: inset(60% 0 5% 0);
    }

    100% {
        clip-path: inset(40% 0 30% 0);
    }
}

.description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 450px;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(112, 0, 255, 0.4);
}

.primary-btn:hover {
    background: transparent;
    color: var(--primary-color);
    box-shadow: 0 0 25px rgba(112, 0, 255, 0.6);
}

.secondary-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-muted);
}

.secondary-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* 3D Cube Animation */
.cube-wrapper {
    width: 200px;
    height: 200px;
    perspective: 1000px;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate 10s infinite linear;
}

.face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid var(--accent-color);
    background: rgba(0, 255, 157, 0.05);
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.1);
}

.front {
    transform: rotateY(0deg) translateZ(100px);
}

.back {
    transform: rotateY(180deg) translateZ(100px);
}

.right {
    transform: rotateY(90deg) translateZ(100px);
}

.left {
    transform: rotateY(-90deg) translateZ(100px);
}

.top {
    transform: rotateX(90deg) translateZ(100px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

@keyframes rotate {
    from {
        transform: rotateX(0deg) rotateY(0deg);
    }

    to {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

/* Section Common */
.section {
    padding: 6rem 10%;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
}

/* About Section */
.about-grid {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: #ccc;
    font-size: 1.05rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
}

.skill-tags span {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}


/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.project-card {
    position: relative;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s, border-color 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--card-bg);
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: var(--primary-color);
}

.project-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: transform 0.6s ease;
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback for placeholder div if no img tag */
.project-image .placeholder-img {
    width: 100%;
    height: 100%;
    background: #1f1f2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image .placeholder-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    padding-top: 6rem;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 50%, transparent 100%);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.project-content h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-main);
    font-weight: 500;
    letter-spacing: normal;
    white-space: nowrap;
}

.status-badge.dev {
    background: rgba(255, 166, 0, 0.15);
    color: #ffae00;
    border: 1px solid rgba(255, 166, 0, 0.3);
}

.status-badge.unfinished {
    background: rgba(255, 0, 85, 0.15);
    color: #ff3366;
    border: 1px solid rgba(255, 0, 85, 0.3);
}

.project-desc {
    font-size: 1rem;
    color: #ddd;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tags span {
    font-size: 0.75rem;
    background: rgba(0, 136, 255, 0.2);
    color: #4db3ff;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 136, 255, 0.3);
    backdrop-filter: blur(4px);
}

.project-links {
    display: flex;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.project-card:hover .project-links {
    opacity: 1;
    transform: translateY(0);
}

.project-links a {
    text-decoration: none;
    color: #fff;
    font-size: 0.9rem;
    transition: color 0.3s;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-links a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Modal Styles */
dialog {
    padding: 0;
    border: none;
    border-radius: 16px;
    background: transparent;
    max-width: 1200px;
    width: 95%;
    margin: auto;
    color: var(--text-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 136, 255, 0.2);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--primary-color);
}

.modal-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-image-container {
    width: 100%;
    height: auto;
    max-height: 60vh;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.modal-info {
    padding: 2.5rem;
}

.modal-info h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-info .tags {
    margin-bottom: 2rem;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 2rem;
}

.modal-links {
    display: flex;
    gap: 1rem;
}

@media (min-width: 900px) {

    /* Vertical layout is default, just ensure height is good */
    .modal-content {
        max-height: 95vh;
    }

    .modal-info {
        padding: 4rem;
        width: 100%;
    }
}

/* Contact Section */
.contact-wrapper {
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.5rem;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0;
        top: 70px;
        background: var(--card-bg);
        flex-direction: column;
        width: 100%;
        text-align: center;
        padding: 2rem 0;
        transform: translateY(-150%);
        transition: transform 0.4s ease;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .hamburger {
        display: block;
        z-index: 101;
    }

    .lang-switch {
        margin-left: auto;
        margin-right: 1.5rem;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero {
        flex-direction: column-reverse;
        justify-content: center;
        gap: 3rem;
        padding-top: 80px;
        text-align: center;
        height: min-content;
        min-height: 100vh;
        padding-bottom: 4rem;
    }

    .hero-content {
        width: 100%;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero-btns {
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        height: 90vh;
        max-height: 90vh;
        margin: 5vh auto;
    }

    .modal-image-container {
        max-height: 30vh;
    }

    .modal-info {
        padding: 1.5rem;
    }

    .modal-info h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .project-card {
        height: 350px;
    }

    .modal-links {
        flex-direction: column;
    }

    .modal-links a {
        text-align: center;
        justify-content: center;
    }
}

.click-hint {
    display: block;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--accent-color);
    opacity: 0.8;
    transform: translateY(10px);
    transition: all 0.3s ease;
    text-align: right;
    font-weight: 500;
    pointer-events: none;
    /* Let clicks pass through to card */
}

.project-card:hover .click-hint {
    opacity: 1;
    transform: translateY(0);
}