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

html {
    scroll-padding-top: 80px;
}

body {
    background: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    overflow-x: hidden;
}

/* Background grid effect */
.bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.05;
}

.grid-bg {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(0deg, rgba(0,212,255,.1) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(0,212,255,.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveGrid 15s linear infinite;
}

@keyframes moveGrid {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

.content-wrapper {
    position: relative;
    z-index: 10;
}

/* Navigation bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    transition: transform 0.3s ease-in-out;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 80rem;
    margin: 0 auto;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
}

.nav-links {
    display: flex;
    gap: 2rem;
    font-size: 1.2rem;
    z-index: 41;
}

.nav-links a {
    position: relative;
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-block;
}

.nav-links a::before,
.nav-links a::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    pointer-events: none;
}

.nav-links a:hover::before {
    left: 2px;
    top: -2px;
    color: #00ffff;
    opacity: 0.8;
    animation: glitchShift 0.15s infinite;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.nav-links a:hover::after {
    left: -2px;
    top: 2px;
    color: #ff0000;
    opacity: 0.8;
    animation: glitchShift2 0.15s infinite;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 0.4rem;
}

@keyframes glitchShift {
    0% { transform: translate(0, 0); }
    50% { transform: translate(2px, -2px); }
    100% { transform: translate(-1px, 1px); }
}

@keyframes glitchShift2 {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-2px, 2px); }
    100% { transform: translate(1px, -1px); }
}

/* Hero section */
.top {
    padding: 5rem 1.5rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background-image: url('../images/joi.gif');
    background-size: cover;
    background-position: center;
    z-index: -1;
    pointer-events: none;
}

.top-content {
    max-width: 80rem;
    position: relative;
    z-index: 2;
}

.top-title {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 5rem;
    position: relative;
    z-index: 10;
}

.top-bio {
    max-width: 32rem;
    margin-bottom: 2rem;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.75;
    color: #9ca3af;
    background: rgba(0, 0, 0, 0.6);
    display: fit-content;
}

.cursor {
    animation: blink 0.6s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.top-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: 2px solid #00d4ff;
    color: #00d4ff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: rgba(0, 212, 255, 0.1);
}

.scroll-hint {
    font-size: 0.75rem;
    color: #ffffff;
}

/* Projects section */
.projects {
    padding: 5rem 1.5rem;
}

.container {
    max-width: 80rem;
    margin: 0 auto;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 900;
    margin-bottom: 4rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    cursor: pointer;
    transition: transform 0.3s;
}

.project-image {
    height: 16rem;
    border: 2px solid;
    overflow: hidden;
    position: relative;
    transition: all 0.3s;
}

.project-gradient {
    width: 100%;
    height: 100%;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.project-card:hover .project-gradient {
    opacity: 1;
}

.project-card:hover .project-image {
    transform: scale(1.02) translateY(-4px);
}

.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,.3) 0px,
        rgba(0,0,0,.3) 2px,
        transparent 2px,
        transparent 4px
    );
    animation: scanlines 0.15s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover .scanlines {
    opacity: 1;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

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

.project-type {
    font-size: 0.875rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.view-text {
    font-size: 1.125rem;
}

.project-info {
    padding: 1rem;
    border: 2px solid;
    border-top: none;
    transition: all 0.3s;
}

.project-title {
    font-weight: 900;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.project-desc {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

.project-index {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #4b5563;
}

/* About section */
.about {
    padding: 5rem 1.5rem;
    border-top: 1px solid #1f2937;
}

.container-about {
    max-width: 64rem;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.about-text {
    color: #d1d5db;
    line-height: 1.75;
    font-size: 0.875rem;
}

.about-text p {
    margin: 0;
    white-space: pre-line;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-label {
    font-size: 0.75rem;
    color: #4b5563;
    margin-bottom: 0.75rem;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.info-item {
    cursor: pointer;
    position: relative;
    padding: 0.25rem 0;
    opacity: 1;
    transform: translateX(0);
}

.info-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, #00ffff, #ff0000);
    transition: width 0.3s;
}

.info-item:hover::after {
    width: 100%;
}

.info-item.gradient-text {
    background: linear-gradient(90deg, #00ffff, #ff0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Artist statement */
.artist-statement {
    padding-bottom: 10rem;
}

#statement-text {
    white-space: pre-line;
    word-wrap: break-word;
}

/* Footer */
.footer {
    padding: 2rem 1.5rem;
    border-top: 1px solid #1f2937;
    text-align: center;
    font-size: 0.75rem;
    color: #4b5563;
}

/* Modal popup */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #000;
    border: 2px solid #fff;
    max-width: 42rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid #fff;
    pointer-events: none;
    animation: boxGlitch 0.15s infinite;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #ff0000;
}

.modal-title {
    font-size: 2.25rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: #fff !important;
    position: relative;
    animation: titleGlitch 0.2s infinite;
}

.modal-meta,
.modal-description,
.modal-tools {
    border: 1px solid #fff;
    padding: 0.5rem;
    position: relative;
    margin-bottom: 1.5rem;
    color: #fff;
}

.modal-meta::after,
.modal-description::after,
.modal-tools::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid #fff;
    pointer-events: none;
    animation: boxGlitch 0.15s infinite;
}

.modal-description {
    padding: 1rem;
}

.modal-tools {
    padding: 1rem;
}

.modal-tools .info-label {
    position: relative;
    z-index: 1;
    color: #fff;
}

.modal-image {
    margin-bottom: 1.5rem;
    position: relative;
}

.modal-image img {
    width: 100%;
    height: auto;
    border: 1px solid #fff;
    display: block;
}

.modal-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid #fff;
    pointer-events: none;
    animation: boxGlitch 0.15s infinite;
}

.tools-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tool-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid #fff;
    color: #fff;
}

.modal-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-link {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    color: #fff;
    position: relative;
    transition: all 0.3s;
}

.modal-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid #fff;
    pointer-events: none;
    animation: boxGlitch 0.15s infinite;
}

.modal-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Glitch text effect */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text.active::before,
.glitch-text.active::after,
.glitch-text.glitch-always::before,
.glitch-text.glitch-always::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
}

.glitch-text.active::before,
.glitch-text.glitch-always::before {
    left: 3px;
    top: 3px;
    color: #00ffff;
    opacity: 0.9;
    animation: glitchCyan 0.5s infinite;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.glitch-text.active::after,
.glitch-text.glitch-always::after {
    left: -3px;
    top: -3px;
    color: #ff0000;
    opacity: 0.9;
    animation: glitchRed 0.5s infinite;   
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

@keyframes glitchCyan {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
    10% { clip-path: inset(5% 0 80% 0); transform: translate(3px, -2px); }
    20% { clip-path: inset(0 0 60% 0); transform: translate(1px, 3px); }
    30% { clip-path: inset(20% 0 0 0); transform: translate(-2px, 1px); }
    40% { clip-path: inset(0 0 40% 0); transform: translate(2px, -3px); }
    50% { clip-path: inset(60% 0 10% 0); transform: translate(-1px, 2px); }
    60% { clip-path: inset(0 0 20% 0); transform: translate(3px, 1px); }
    70% { clip-path: inset(40% 0 5% 0); transform: translate(-2px, -1px); }
    80% { clip-path: inset(0 0 75% 0); transform: translate(1px, -2px); }
    90% { clip-path: inset(10% 0 30% 0); transform: translate(-3px, 2px); }
}

@keyframes glitchRed {
    0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
    10% { clip-path: inset(75% 0 5% 0); transform: translate(-3px, 2px); }
    20% { clip-path: inset(30% 0 0 0); transform: translate(-1px, -3px); }
    30% { clip-path: inset(0 0 50% 0); transform: translate(2px, -1px); }
    40% { clip-path: inset(50% 0 0 0); transform: translate(-2px, 3px); }
    50% { clip-path: inset(0 0 15% 0); transform: translate(1px, -2px); }
    60% { clip-path: inset(20% 0 40% 0); transform: translate(-3px, -1px); }
    70% { clip-path: inset(0 0 60% 0); transform: translate(2px, 2px); }
    80% { clip-path: inset(35% 0 10% 0); transform: translate(-1px, 1px); }
    90% { clip-path: inset(0 0 25% 0); transform: translate(3px, -2px); }
}

@keyframes titleGlitch {
    0%, 30%, 60%, 100% { clip-path: inset(0 0 0 0); }
    15% { clip-path: inset(20% 0 70% 0); }
    45% { clip-path: inset(60% 0 25% 0); }
}

@keyframes boxGlitch {
    0%, 25%, 50%, 75%, 100% { 
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
    12% { 
        clip-path: inset(5% 0 80% 0);
        opacity: 0.7;
    }
    37% { 
        clip-path: inset(50% 0 30% 0);
        opacity: 0.6;
    }
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 0.5rem;
    padding: 0.5rem;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
    display: block;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

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

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

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(0, 0, 0, 0.99);
        padding: 0;
        border-bottom: 1px solid rgba(0, 212, 255, 0.3);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        font-size: 1rem;
        display: none;
    }
    
    .nav-links.active {
        display: flex;
        max-height: 500px;
    }
    
    .nav-links a {
        display: block;
        padding: 1.2rem 1.5rem;
        border-bottom: 1px solid rgba(0, 212, 255, 0.1);
        text-decoration: none;
        color: #fff;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .nav-content {
        justify-content: space-between;
    }
    
    .top-title {
        font-size: 3.5rem;
    }
    
    .projects-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }
}