/* Terminal Loading Screen */
.terminal-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0f;
    z-index: 10000;
    display: grid;
    place-items: center;
    transition: opacity 0.5s ease;
}

.terminal-loader.hide {
    opacity: 0;
    pointer-events: none;
}

.terminal-window {
    width: 90%;
    max-width: 700px;
    background: #1a1a2e;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.3);
    border: 1px solid #00d4ff;
    overflow: hidden;
    margin: 0 auto;
}

.terminal-header {
    background: #282a36;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #00d4ff;
}

.terminal-title {
    color: #00ff88;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.terminal-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff006e;
}

.terminal-control:nth-child(2) {
    background: #ffb626;
}

.terminal-control:nth-child(3) {
    background: #00ff88;
}

.terminal-body {
    padding: 20px;
    height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #00ff88;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #00d4ff #1a1a2e;
}

.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

#terminal-output {
    white-space: pre-wrap;
    word-wrap: break-word;
}

#terminal-output .command {
    color: #00d4ff;
}

#terminal-output .output {
    color: #00ff88;
}

#terminal-output .error {
    color: #ff006e;
}

#terminal-output .warning {
    color: #ffb626;
}

#terminal-output .success {
    color: #00ff88;
}

#terminal-output .progress {
    color: #a855f7;
}

.terminal-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    color: #ffffff;
    position: absolute;
    margin-top: 8px;
    margin-left: 20px;
}

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

/* Terminal responsive adjustments */
@media (max-height: 700px) {
    .terminal-window {
        max-height: 85vh;
    }
    
    .terminal-body {
        height: 250px;
    }
}

@media (max-height: 500px) {
    .terminal-body {
        height: 180px;
        font-size: 12px;
        line-height: 1.4;
    }
}

/* Global Styles */
:root {
    --primary-dark: #0a0a0f;
    --secondary-dark: #141420;
    --tertiary-dark: #1a1a2e;
    --neon-blue: #00d4ff;
    --neon-green: #00ff88;
    --neon-purple: #a855f7;
    --neon-pink: #ff006e;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --text-tertiary: #6b6b8a;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(20, 20, 32, 0.6);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
    --gradient-hero: linear-gradient(180deg, rgba(10,10,15,1) 0%, rgba(10,10,15,0.8) 50%, rgba(10,10,15,0) 100%);
}

/* Custom Scrollbar Styling */
/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--primary-dark);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--tertiary-dark);
    border-radius: 10px;
    border: 2px solid var(--primary-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-purple);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

::-webkit-scrollbar-thumb:active {
    background: var(--neon-blue);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--tertiary-dark) var(--primary-dark);
}

[data-theme="light"] {
    --primary-dark: #ffffff;
    --secondary-dark: #f8f9fa;
    --tertiary-dark: #e9ecef;
    --neon-blue: #0066cc;
    --neon-green: #00aa44;
    --neon-purple: #8b5cf6;
    --neon-pink: #ec4899;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #6c757d;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.9);
    --gradient-hero: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
}

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

html {
    scroll-behavior: smooth;
}

/* Use system fonts that look like Cascadia Mono */

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: var(--primary-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Enhanced crispness for normal mode */
    filter: contrast(1.1) brightness(1.02) saturate(1.15);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Smooth scrolling performance */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Performance optimizations */
    contain: layout style paint;
    transform: translateZ(0);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    /* Enhanced text crispness */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-text {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    position: relative;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-2);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.theme-toggle {
    background: transparent;
    border: 2px solid var(--neon-purple);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--neon-purple);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.hamburger {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--neon-blue);
    margin: 3px 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

/* Hero Section with Blended Transition */
.hero-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dark);
    overflow: hidden;
}

.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.particle {
    position: absolute;
    background: var(--neon-blue);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s infinite linear;
    box-shadow: 0 0 10px currentColor;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

@keyframes float {
    from {
        transform: translateY(100vh) translateX(0);
    }
    to {
        transform: translateY(-100vh) translateX(100px);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
    font-family: 'Consolas', 'Monaco', 'Courier New', 'SF Mono', 'Menlo', 'Liberation Mono', monospace;
}

.name-intro {
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
    will-change: filter;
    transform: translateZ(0);
    font-family: 'Consolas', 'Monaco', 'Courier New', 'SF Mono', 'Menlo', 'Liberation Mono', monospace;
}

.name-intro::before,
.name-intro::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: glitchFlicker 2s infinite;
    z-index: -1;
}

.name-intro::after {
    animation-delay: 0.2s;
    animation-duration: 1.8s;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes glitchFlicker {
    0%, 85%, 100% {
        opacity: 0;
        transform: translate(0);
    }
    86% {
        opacity: 1;
        transform: translate(-4px, 3px);
        filter: hue-rotate(180deg) saturate(2);
    }
    87% {
        opacity: 0;
        transform: translate(0);
    }
    88% {
        opacity: 0.9;
        transform: translate(3px, -4px);
        filter: hue-rotate(270deg) saturate(1.5);
    }
    89% {
        opacity: 0;
        transform: translate(0);
    }
    90% {
        opacity: 1;
        transform: translate(-2px, -2px);
        filter: hue-rotate(90deg) brightness(1.5);
    }
    91% {
        opacity: 0.7;
        transform: translate(4px, 2px);
        filter: hue-rotate(45deg) contrast(2);
    }
    93% {
        opacity: 0;
        transform: translate(0);
    }
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
    }
    to {
        filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.8));
    }
}

.title-separator {
    color: var(--text-tertiary);
    margin: 0 0.5rem;
}

.portfolio-text {
    color: var(--text-secondary);
    opacity: 0.8;
    position: relative;
    font-family: 'Consolas', 'Monaco', 'Courier New', 'SF Mono', 'Menlo', 'Liberation Mono', monospace;
}

.portfolio-text::before,
.portfolio-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: glitchFlicker 2.2s infinite;
    z-index: -1;
}

.portfolio-text::after {
    animation-delay: 0.3s;
    animation-duration: 1.9s;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta {
    margin-top: 3rem;
}

.scroll-indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--neon-blue);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

.scroll-text {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 2px;
}

.scroll-arrow {
    fill: currentColor;
    filter: drop-shadow(0 0 10px currentColor);
}


/* Quick Links Section */
.quick-links {
    position: relative;
    padding: 4rem 0 6rem;
    background: var(--primary-dark);
    z-index: 3;
}

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

.card-link {
    display: block;
    transition: transform 0.3s ease;
}

.card-link:hover {
    transform: translateY(-10px);
}

.quick-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    will-change: transform;
}

.quick-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.quick-card:hover::before {
    transform: translateX(0);
}

.quick-card:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.1);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
}

.quick-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.quick-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Featured Preview Section */
.featured-preview {
    padding: 4rem 0;
    background: var(--primary-dark);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.featured-project {
    max-width: 800px;
    margin: 0 auto;
}

.project-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--tertiary-dark);
    z-index: 9999;
    isolation: isolate;
}

.preview-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 10000;
}

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

.preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(180deg, transparent, rgba(10, 10, 15, 0.95));
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.project-preview:hover .preview-overlay {
    transform: translateY(0);
}

.preview-overlay h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--neon-blue);
}

.preview-overlay p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.view-live {
    color: var(--neon-blue);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
    margin-bottom: 0.5rem;
    margin-right: 1rem;
}

.view-live:hover {
    gap: 1rem;
}

.view-more {
    color: var(--neon-green);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.view-more:hover {
    gap: 1rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    margin-top: 80px; /* Account for fixed navbar */
    padding: 1rem 0;
}

[data-theme="light"] .breadcrumb {
    background: rgba(255, 255, 255, 0.8);
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.breadcrumb-list a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.breadcrumb-list a:hover {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.breadcrumb-list li[aria-current="page"] {
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Page Hero (for inner pages) */
.page-hero {
    height: 300px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--primary-dark);
    margin-top: 60px;
    overflow: hidden;
    /* Remove any background gradients that might show as black bars */
    background-image: none;
}

.page-title {
    font-size: 3rem;
    position: relative;
    z-index: 2;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.5));
    margin-bottom: 1rem;
}

.page-hero .hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

/* About Page Styles */
.about-content {
    padding: 4rem 0;
    background: var(--primary-dark);
}

.bio-section {
    margin-bottom: 4rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.bio-text h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--neon-blue);
}

.bio-text {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.bio-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.bio-text p:last-child {
    margin-bottom: 0;
}

.bio-placeholder {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-left: 3px solid var(--neon-green);
    border-radius: 4px;
}

.section-subtitle {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--neon-purple);
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.skill-item {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-5px);
    border-color: var(--neon-blue);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.skill-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.skill-item p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
    margin-bottom: 4rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-2);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    padding: 2rem;
    width: calc(50% - 40px);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeIn 0.6s forwards;
}

.timeline-item:nth-child(even) {
    margin-left: auto;
}

.timeline-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--neon-blue);
    border-radius: 50%;
    top: 2rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.timeline-item:nth-child(odd) .timeline-marker {
    right: -50px;
}

.timeline-item:nth-child(even) .timeline-marker {
    left: -50px;
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.timeline-content h3 {
    color: var(--neon-green);
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-secondary);
}

/* Interests */
.interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.interest-item {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 25px;
    border: 1px solid var(--neon-purple);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.interest-item:hover {
    background: var(--neon-purple);
    transform: scale(1.05);
}

.interest-emoji {
    font-size: 1.5rem;
}

/* Projects Page */
.projects-section {
    padding: 4rem 0;
    background: var(--primary-dark);
}

.projects-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 9999;
    transform: translateZ(0);
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.2);
}

.project-image {
    position: relative;
    overflow: hidden;
    /* Create clean background for project images */
    background: var(--tertiary-dark);
}

.project-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    /* Disable noise overlay on project images for clarity */
    position: relative;
    z-index: 10000;
    display: block;
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-link {
    color: var(--neon-green);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--neon-green);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--neon-green);
    color: var(--primary-dark);
}

.project-content {
    padding: 1rem;
}

.project-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--neon-blue);
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-badge {
    background: rgba(168, 85, 247, 0.2);
    color: var(--neon-purple);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    border: 1px solid var(--neon-purple);
}

.project-features h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-features ul {
    list-style: none;
    color: var(--text-secondary);
}

.project-features li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.project-features li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--neon-green);
}

.project-highlights {
    margin-top: 1.5rem;
}

.project-highlights h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-highlights ul {
    list-style: none;
    color: var(--text-secondary);
}

.project-highlights li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.project-highlights li::before {
    content: '★';
    position: absolute;
    left: 0;
    color: var(--neon-blue);
}

/* Code Showcase */
.code-showcase {
    margin-top: 4rem;
}

.code-block {
    background: var(--tertiary-dark);
    border-radius: 12px;
    padding: 2rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: var(--neon-green);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Services Page Loader */
.services-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.services-loader.hide {
    opacity: 0;
    visibility: hidden;
}

.services-loader-content {
    text-align: center;
    padding: 2rem;
}

.loader-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.loader-text {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: loading-dots 1.4s ease-in-out infinite both;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    }
}

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Services Page */
.services-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.services-intro {
    text-align: center;
    margin-bottom: 4rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.service-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.1);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.service-card h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-features li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 1.5rem;
}

.service-features li:last-child {
    border-bottom: none;
}

.service-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: bold;
}

.cta-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(0, 255, 136, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.cta-section h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-1);
    color: var(--bg-primary);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4);
}

/* Internal Linking Styles */
.inline-link {
    color: var(--accent-cyan);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.inline-link:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.inline-hero-link {
    color: var(--accent-cyan);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--accent-cyan);
}

.inline-hero-link:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
    text-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
    transform: translateY(-1px);
}

/* Contact Page */
.contact-section {
    padding: 4rem 0;
    background: var(--primary-dark);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form Validation Styles */
.form-group.has-error input,
.form-group.has-error textarea {
    border-color: var(--neon-pink);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.3);
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--neon-pink);
    animation: shake 0.5s ease-in-out;
}

.error-message {
    color: var(--neon-pink);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.submit-btn {
    background: var(--gradient-2);
    color: var(--primary-dark);
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.contact-intro {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    align-items: start;
}

.contact-icon {
    font-size: 1.5rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.contact-item h3 {
    color: var(--neon-purple);
    margin-bottom: 0.25rem;
}

.contact-item a {
    color: var(--text-secondary);
}

.contact-item a:hover {
    color: var(--neon-blue);
}

/* Social Links */
.social-links h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.social-grid {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--gradient-2);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.social-link svg {
    fill: currentColor;
}

/* Footer */
.footer {
    background: var(--secondary-dark);
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--neon-blue);
}

.footer-links svg {
    flex-shrink: 0;
}

/* Scramble text effect */
.scramble {
    color: var(--neon-blue);
    text-shadow: 
        0 0 10px currentColor,
        1px 1px 0 rgba(255, 0, 110, 0.5),
        -1px -1px 0 rgba(0, 255, 136, 0.5);
    display: inline-block;
    animation: scrambleGlitch 0.1s infinite;
}

.scramble.glitch-color {
    color: var(--neon-pink);
    text-shadow: 
        0 0 15px currentColor,
        2px 2px 0 var(--neon-green),
        -2px -2px 0 var(--neon-purple);
    transform: skew(-5deg);
}

@keyframes scrambleGlitch {
    0% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    20% {
        transform: translate(-1px, 1px);
        filter: hue-rotate(90deg);
    }
    40% {
        transform: translate(1px, -1px);
        filter: hue-rotate(180deg);
    }
    60% {
        transform: translate(-1px, 0);
        filter: hue-rotate(270deg);
    }
    80% {
        transform: translate(1px, 0);
        filter: hue-rotate(360deg);
    }
    100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
}


/* Noise overlay styles - reduce white overlay effect */
.noise-overlay {
    display: none;
}

/* Disable noise overlay interference with project images */
.project-image {
    isolation: isolate;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 10001;
    pointer-events: none;
}

/* Enhanced hero section with layered effects */
.hero-section {
    position: relative;
    overflow: hidden;
    /* Remove any white overlay effects */
    background: var(--primary-dark);
}


/* Remove any pseudo-elements from page heroes that might cause black bars */
.page-hero::before,
.page-hero::after {
    display: none;
}



/* Retro CRT Filter Toggle - Add class to body to enable */

body.retro-filter-disabled::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, 
            rgba(0,255,136,0.02) 0%, 
            rgba(0,212,255,0.01) 40%, 
            transparent 100%);
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}

body.retro-filter-disabled .hero-section,
body.retro-filter-disabled .about-content,
body.retro-filter-disabled .projects-section,
body.retro-filter-disabled .contact-section {
    filter: 
        drop-shadow(0 0 3px rgba(0, 255, 136, 0.3))
        drop-shadow(2px 0 0 rgba(255, 0, 110, 0.15))
        drop-shadow(-2px 0 0 rgba(0, 212, 255, 0.15));
}

@keyframes crtFlicker {
    0% {
        opacity: 1;
    }
    97% {
        opacity: 1;
    }
    98% {
        opacity: 0.98;
    }
    99% {
        opacity: 1;
    }
    100% {
        opacity: 0.99;
    }
}

/* CRT Curvature Effect */
body.retro-filter-disabled .container {
    transform: perspective(1000px) rotateX(0.5deg);
}

/* Enhanced Phosphor Glow */
body.retro-filter-disabled h1,
body.retro-filter-disabled h2,
body.retro-filter-disabled h3 {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor;
}


/* Enhanced glitch effects for various elements */
.quick-card:hover {
    animation: cardGlitch 0.2s ease-in-out;
}

@keyframes cardGlitch {
    0%, 100% {
        transform: translateY(-10px);
    }
    25% {
        transform: translateY(-10px) translateX(2px);
        filter: hue-rotate(90deg);
    }
    50% {
        transform: translateY(-10px) translateX(-2px);
        filter: hue-rotate(180deg);
    }
    75% {
        transform: translateY(-10px) translateX(1px);
        filter: hue-rotate(270deg);
    }
}

/* Project card enhanced effects */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 49%, rgba(0, 212, 255, 0.1) 50%, transparent 51%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
    animation: scanMove 1s ease-in-out infinite;
}

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

/* Glitch effect for nav links */
@keyframes glitch {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(0, 212, 255, 0.5),
            -2px 0 var(--neon-pink),
            2px 0 var(--neon-green);
        transform: translate(0);
    }
    20% {
        text-shadow: 
            0 0 10px rgba(0, 212, 255, 0.5),
            -2px 0 var(--neon-green),
            2px 0 var(--neon-pink);
        transform: translate(-2px, 2px);
    }
    40% {
        text-shadow: 
            0 0 10px rgba(0, 212, 255, 0.5),
            -2px 0 var(--neon-pink),
            2px 0 var(--neon-purple);
        transform: translate(-2px, -2px);
    }
    60% {
        text-shadow: 
            0 0 10px rgba(0, 212, 255, 0.5),
            2px 0 var(--neon-green),
            -2px 0 var(--neon-pink);
        transform: translate(2px, 2px);
    }
    80% {
        text-shadow: 
            0 0 10px rgba(0, 212, 255, 0.5),
            2px 0 var(--neon-purple),
            -2px 0 var(--neon-green);
        transform: translate(2px, -2px);
    }
}

.nav-link:hover {
    animation: glitch 0.3s ease-in-out;
}

/* Magnetic button effect */
.submit-btn, .project-link {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Enhanced scroll animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item:nth-child(odd) {
    animation: slideInLeft 0.6s ease-out forwards;
}

.timeline-item:nth-child(even) {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Animations */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Safari-specific fixes for Matrix Rain */
@supports (-webkit-appearance: none) and (stroke-color: transparent) {
    .matrix-rain {
        -webkit-transform: translate3d(0, 0, 0);
        -webkit-backface-visibility: hidden;
        -webkit-perspective: 1000px;
    }
}

/* Safari mobile specific */
@supports (-webkit-touch-callout: none) {
    .matrix-rain {
        will-change: transform;
        transform: translateZ(0);
    }
}

/* Loading Indicators */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-tertiary);
    border-radius: 50%;
    border-top-color: var(--neon-blue);
    animation: spin 0.8s linear infinite;
}

.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 8px;
}

.loading-pulse {
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Form Loading States */
.submit-btn .loading-spinner {
    margin-right: 8px;
}

.form-loading .form-group {
    pointer-events: none;
    opacity: 0.7;
}

/* Page Loading Transition */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Content Loading States */
.content-loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-card {
    height: 200px;
    width: 100%;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 2rem;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .hamburger {
        display: flex;
    }
    
    .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);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .bio-section {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        width: calc(100% - 40px);
        margin-left: 40px;
    }
    
    .timeline-item .timeline-marker {
        left: -30px !important;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .footer .container {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .social-grid {
        flex-direction: column;
    }
}