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

:root {
    --bg: #0a0f0a;
    --text: #e8f0e8;
    --text-muted: #90a890;
    --lilac-light: #d8ffd8;
    --lilac: #a8e0a8;
    --purple: #78c878;
    --purple-dark: #48a048;
    --accent: #c8ffc8;
    --border: rgba(120, 200, 120, 0.15);
    --glow: rgba(200, 255, 200, 0.4);
    --red-accent: #ff4444;
}

body {
    font-family: 'Kode Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(10, 10, 15, 0.5) 100%);
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 30px;
    position: relative;
    z-index: 2;
}

/* Hero Section */
.hero {
    margin-bottom: 80px;
}

.neofetch {
    display: flex;
    gap: 40px;
    max-width: 900px;
}

.neofetch-image {
    flex-shrink: 0;
    position: relative;
}

.neofetch-image:hover .avatar {
    animation: glitchPulse 0.3s ease-in-out, glitchIntense 0.5s ease-in-out;
}

.neofetch-image:hover .avatar::before {
    animation: glitchShift 0.2s ease-in-out infinite;
}

@keyframes glitchIntense {
    0%, 100% {
        transform: translate(0, 0);
    }
    20% {
        transform: translate(-2px, 2px);
        filter: saturate(1.5) contrast(1.5) hue-rotate(15deg);
    }
    40% {
        transform: translate(2px, -2px);
        filter: saturate(0.5) contrast(1.8) hue-rotate(-15deg);
    }
    60% {
        transform: translate(-1px, -1px);
        filter: saturate(1.2) contrast(1.3) hue-rotate(8deg);
    }
    80% {
        transform: translate(1px, 1px);
        filter: saturate(0.8) contrast(1.4) hue-rotate(-8deg);
    }
}

.avatar {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    filter: saturate(0.85) contrast(1.15) brightness(1.05);
    border: 1px solid var(--purple);
    box-shadow: 
        0 0 20px rgba(120, 200, 120, 0.3),
        0 0 40px rgba(120, 200, 120, 0.15),
        inset 0 0 60px rgba(200, 255, 200, 0.05);
    position: relative;
    animation: glitchPulse 5s ease-in-out infinite;
}

.avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -3px;
    width: calc(100% + 6px);
    height: 100%;
    background: inherit;
    background-image: inherit;
    opacity: 0;
    mix-blend-mode: screen;
    animation: glitchShift 7s ease-in-out infinite;
}

.avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(180deg, transparent 0%, rgba(120, 200, 120, 0.1) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(120, 200, 120, 0.05) 2px,
            rgba(120, 200, 120, 0.05) 4px
        );
    pointer-events: none;
    mix-blend-mode: overlay;
    animation: scanlineAvatar 3s linear infinite;
}

@keyframes glitchPulse {
    0%, 85%, 100% {
        filter: saturate(0.85) contrast(1.15) brightness(1.05);
    }
    87% {
        filter: saturate(1.3) contrast(1.4) brightness(1.15) hue-rotate(10deg) blur(0.5px);
    }
    88% {
        filter: saturate(0.5) contrast(1.5) brightness(0.9) hue-rotate(-8deg) blur(0px);
    }
    89% {
        filter: saturate(1.1) contrast(1.3) brightness(1.1) hue-rotate(5deg) blur(0.3px);
    }
    91% {
        filter: saturate(0.85) contrast(1.15) brightness(1.05);
    }
    93% {
        filter: saturate(0.85) contrast(1.15) brightness(1.05) blur(0px);
    }
}

@keyframes glitchShift {
    0%, 92%, 100% {
        opacity: 0;
        transform: translateX(0);
    }
    93% {
        opacity: 0.7;
        transform: translateX(-5px);
        filter: hue-rotate(90deg);
    }
    94% {
        opacity: 0.7;
        transform: translateX(5px);
        filter: hue-rotate(-90deg);
    }
    95% {
        opacity: 0;
        transform: translateX(0);
    }
}

@keyframes scanlineAvatar {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Fallback for missing image */
.avatar[alt="avatar"]:not([src]) {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple));
    color: var(--lilac-light);
    font-size: 3rem;
    font-weight: 700;
}

.neofetch-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
}

.header {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.user {
    color: var(--lilac);
}

.at {
    color: var(--text);
}

.host {
    color: var(--purple);
}

.separator {
    color: var(--purple-dark);
    margin: 1px 0;
}

.line {
    display: flex;
    line-height: 1.4;
}

.key {
    color: var(--lilac);
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
}

.separator-char {
    color: var(--text);
    margin: 0 4px;
}

.value {
    color: var(--text);
}

.colors {
    display: flex;
    gap: 5px;
    margin-top: 2px;
}

.color-block {
    width: 24px;
    height: 12px;
    border-radius: 2px;
}

/* Sections */
.section {
    margin-bottom: 60px;
}

.section-header {
    margin-bottom: 20px;
    font-size: 13px;
}

.prompt {
    color: var(--purple);
    margin-right: 8px;
}

.command {
    color: var(--lilac);
}

.content-box {
    background: rgba(120, 200, 120, 0.02);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 30px;
    backdrop-filter: blur(10px);
    position: relative;
    box-shadow: 
        0 0 20px rgba(120, 200, 120, 0.05),
        inset 0 0 60px rgba(120, 200, 120, 0.02);
}

.content-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--purple), transparent);
    animation: borderScan 3s ease-in-out infinite;
}

@keyframes borderScan {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
}

/* Bio Section */
.bio-section p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text);
}

.bio-section p:last-of-type {
    margin-bottom: 24px;
}

.bio-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.link {
    color: var(--lilac);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    text-shadow: 0 0 8px rgba(120, 200, 120, 0.3);
}

.link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--lilac);
    box-shadow: 0 0 8px var(--glow);
    transition: width 0.2s ease;
}

.link:hover {
    color: var(--lilac-light);
    text-shadow: 0 0 12px var(--glow);
}

.link:hover::after {
    width: 100%;
}

.separator-dot {
    color: var(--purple-dark);
    font-size: 10px;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    background: rgba(120, 200, 120, 0.02);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    color: inherit;
}

.project-card-link {
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(120, 200, 120, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover {
    border-color: var(--purple);
    background: rgba(120, 200, 120, 0.04);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 20px rgba(120, 200, 120, 0.1),
        0 0 40px rgba(120, 200, 120, 0.05);
}

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

.project-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.project-icon {
    font-size: 20px;
    filter: grayscale(0.3);
}

.project-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--lilac);
    margin: 0;
}

.project-desc {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 10px;
    color: var(--purple);
    background: rgba(120, 200, 120, 0.08);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 2px;
    font-weight: 500;
    box-shadow: inset 0 0 10px rgba(120, 200, 120, 0.05);
}

/* Footer */
.footer {
    margin-top: 100px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.footer-content {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 40px 20px;
    }

    .hero {
        margin-bottom: 60px;
    }

    .neofetch {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    
    .avatar {
        width: 160px;
        height: 160px;
    }
    
    .neofetch-info {
        font-size: 12px;
        width: 100%;
    }
    
    .header {
        font-size: 15px;
    }
    
    .key {
        min-width: 80px;
    }

    .section {
        margin-bottom: 50px;
    }

    .content-box {
        padding: 24px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    /* Reduce effects intensity on mobile for better performance */
    body::before {
        opacity: 0.5;
    }
    
    .avatar {
        animation: none; /* Disable glitch pulse on mobile */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 16px;
    }

    .avatar {
        width: 140px;
        height: 140px;
    }
    
    .neofetch-info {
        font-size: 11px;
    }
    
    .header {
        font-size: 14px;
    }
    
    .key {
        min-width: 70px;
    }
    
    .colors {
        flex-wrap: wrap;
    }
    
    .color-block {
        width: 24px;
        height: 12px;
    }

    .content-box {
        padding: 20px;
    }

    .bio-section p {
        font-size: 13px;
    }

    .section-header {
        font-size: 12px;
    }

    .bio-links {
        flex-wrap: wrap;
    }
    
    .project-desc {
        font-size: 11px;
    }
    
    .project-title {
        font-size: 14px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .project-card:hover {
        transform: none;
    }
    
    .project-title:hover {
        animation: none;
    }
    
    /* Make links more touch-friendly */
    .link {
        padding: 4px 0;
        display: inline-block;
    }
    
    /* Disable cursor trail on touch devices */
    .cursor-trail {
        display: none;
    }
}

/* Subtle animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.neofetch {
    animation: fadeIn 0.6s ease-out;
}

.section {
    animation: fadeIn 0.8s ease-out;
    animation-fill-mode: both;
}

.bio-section {
    animation-delay: 0.2s;
}

.projects-section {
    animation-delay: 0.4s;
}

/* Selection color */
::selection {
    background: var(--purple);
    color: var(--bg);
}

/* Text glow effect on selection */
.prompt, .command, .user, .host {
    transition: text-shadow 0.2s ease;
}

.prompt:hover, .command:hover {
    text-shadow: 0 0 8px var(--glow);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Glitch effect (subtle) */
.header {
    position: relative;
}

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

/* CRT flicker */
@keyframes flicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.98;
    }
}

body {
    animation: flicker 0.15s infinite;
}

/* Cursor trail effect */
.cursor-trail {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
    transition: opacity 0.5s ease;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
}

/* Subtle vignette on sections */
.section {
    position: relative;
}

.section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(10, 10, 15, 0.3) 100%);
    pointer-events: none;
    opacity: 0.5;
}

.section > * {
    position: relative;
    z-index: 1;
}

/* Digital noise on hover for certain elements */
@keyframes digitalNoise {
    0%, 100% {
        text-shadow: 0 0 8px rgba(120, 200, 120, 0.3);
    }
    50% {
        text-shadow: 
            0 0 8px rgba(120, 200, 120, 0.5),
            0 0 12px rgba(200, 255, 200, 0.3);
    }
}

.project-title:hover {
    animation: digitalNoise 2s ease-in-out infinite;
}
