/* ========================================
   MATRIX PORTFOLIO - Main Styles
   ======================================== */

/* CSS Variables */
:root {
    /* Premium minimal palette */
    --primary: #00E5FF;
    --secondary: #9D4EDD;
    --accent: #E879F9;
    --white: #FFFFFF;
    --text: #F8FAFC;
    --text-dim: #94A3B8;
    --text-muted: #475569;
    
    /* Glows */
    --glow-primary: rgba(0, 229, 255, 0.4);
    --glow-secondary: rgba(157, 78, 221, 0.4);
    
    /* Background */
    --bg: #050508;
    --bg-subtle: #0A0A0F;
    --bg-card: rgba(15, 15, 25, 0.6);
    
    /* Font */
    --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-width: 1100px;
}

/* Light Mode */
:root[data-theme="light"] {
    --primary: #00B8D4;
    --secondary: #7B1FA2;
    --text: #1E293B;
    --text-dim: #475569;
    --text-muted: #94A3B8;
    --bg: #F8FAFC;
    --bg-subtle: #F1F5F9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --glow-primary: rgba(0, 184, 212, 0.3);
    --glow-secondary: rgba(123, 31, 162, 0.3);
}

/* Light Mode Enhancements */
:root[data-theme="light"] .nav {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .project-card {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .project-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

:root[data-theme="light"] .btn-primary:hover,
:root[data-theme="light"] .btn-secondary:hover {
    box-shadow: 0 5px 20px rgba(0, 184, 212, 0.4);
}

:root[data-theme="light"] .contact-link,
:root[data-theme="light"] .form-group input,
:root[data-theme="light"] .form-group textarea {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-mono);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    cursor: none;
    /* Better mobile rendering */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

/* Reduce Motion Support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .custom-cursor, .custom-cursor-trail {
        display: none !important;
    }
}

/* Skip to Content */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--bg);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 10001;
    font-weight: 600;
}

.skip-to-content:focus {
    top: 0;
}

/* Custom Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, border-width 0.2s;
    box-shadow: 0 0 10px var(--glow-primary);
}

.custom-cursor.hover {
    width: 40px;
    height: 40px;
    border-width: 1px;
    background: rgba(0, 229, 255, 0.1);
}

.custom-cursor-trail {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
    box-shadow: 0 0 20px var(--glow-primary);
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s, visibility 0.5s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

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

.preloader-logo {
    font-size: 3rem;
    color: var(--primary);
    text-shadow: 0 0 20px var(--glow-primary);
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.preloader-bar {
    width: 300px;
    height: 4px;
    background: rgba(0, 229, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.preloader-progress {
    height: 100%;
    background: var(--primary);
    width: 0;
    animation: loading 2s ease-in-out forwards;
    box-shadow: 0 0 10px var(--glow-primary);
}

.preloader-text {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.preloader-text .dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes loading {
    to { width: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0;
    z-index: 9999;
    box-shadow: 0 0 10px var(--glow-primary);
    transition: width 0.1s ease-out;
}

/* Matrix Canvas - Full Screen Background */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
}

#matrixCanvas.lazy-load {
    opacity: 0;
}

#matrixCanvas.loaded {
    opacity: 1;
}

/* Light Mode Canvas Adjustments */
:root[data-theme="light"] #matrixCanvas {
    opacity: 0.3;
    filter: brightness(1.5);
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 229, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    pointer-events: all;
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-out 2.7s;
    opacity: 1;
}

.toast.success {
    border-color: #00E5FF;
}

.toast.error {
    border-color: #FF4444;
}

.toast.warning {
    border-color: #FFA500;
}

.toast.info {
    border-color: #9D4EDD;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    flex: 1;
    color: var(--text);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--text);
}

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Settings Panel */
.settings-trigger {
    position: fixed;
    bottom: 100px;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(0, 229, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: var(--bg);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 998;
    box-shadow: 0 5px 20px var(--glow-primary);
    transition: var(--transition);
}

.settings-trigger:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 10px 30px var(--glow-primary);
}

.settings-trigger.active {
    transform: rotate(45deg);
    background: var(--secondary);
}

.settings-panel {
    position: fixed;
    right: -400px;
    top: 100px;
    width: 320px;
    max-height: calc(80vh - 100px);
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid var(--primary);
    border-radius: 12px 0 0 12px;
    padding: 2rem;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -5px 0 30px rgba(0, 229, 255, 0.3);
    visibility: hidden;
    opacity: 0;
}

.settings-panel.active {
    right: 0;
    visibility: visible;
    opacity: 1;
}

.settings-panel h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.settings-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.settings-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.setting-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(0, 229, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--glow-primary);
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--glow-primary);
}

.setting-value {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--primary);
    font-weight: 600;
}

.setting-group input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.music-select {
    width: 100%;
    padding: 0.5rem;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.music-select:hover,
.music-select:focus {
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.2);
    outline: none;
}

.music-select option {
    background: var(--bg);
    color: var(--text);
}

/* Breadcrumb Navigation */
.breadcrumb {
    position: fixed;
    top: 80px;
    left: 2rem;
    z-index: 999;
    padding: 0.5rem 1rem;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: var(--transition);
}

.breadcrumb.visible {
    opacity: 1;
}

.breadcrumb-item {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.breadcrumb-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.95), transparent);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.nav.scrolled {
    background: rgba(8, 8, 16, 0.98);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 255, 255, 0.15);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    text-shadow: 0 0 10px var(--glow-primary);
    transition: var(--transition);
}

.nav-logo:hover {
    text-shadow: 0 0 20px var(--glow-primary), 0 0 40px var(--glow-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.music-indicator,
.theme-toggle,
.lang-toggle {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: var(--font-mono);
    font-size: 1rem;
}

.music-indicator {
    animation: musicPulse 2s ease-in-out infinite;
}

.music-indicator.paused {
    animation: none;
    opacity: 0.5;
}

@keyframes musicPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    }
}

.theme-toggle:hover,
.lang-toggle:hover,
.music-indicator:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--glow-primary);
    transform: scale(1.1);
}

.theme-icon {
    font-size: 1.2rem;
}

.lang-text {
    font-size: 0.8rem;
    font-weight: 600;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    box-shadow: 0 0 10px var(--glow-primary);
}

.nav-link:hover {
    color: var(--primary);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero-content {
    z-index: 1;
    animation: fadeInUp 1s ease-out;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.hero-greeting {
    display: none;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.2;
}

.hero-title .title-part {
    color: var(--text);
    font-weight: 400;
}

.hero-title .title-agent {
    color: var(--primary);
    text-shadow: 0 0 30px var(--glow-primary);
    font-weight: 700;
}

.hero-title .title-sos {
    color: #FF4444;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
    font-weight: 700;
    animation: sosBlink 2s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.8;
}

.hero-title .title-part {
    color: var(--text);
    font-weight: 400;
}

.hero-title .title-agent {
    color: var(--primary);
    text-shadow: 0 0 30px var(--glow-primary);
    font-weight: 700;
}

.hero-title .title-sos {
    color: #FF4444;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.8);
    display: inline-block;
    font-weight: 700;
    animation: sosBlink 2s ease-in-out infinite;
}

@keyframes sosBlink {
    0%, 100% { 
        opacity: 1;
        text-shadow: 0 0 20px rgba(255, 68, 68, 1), 0 0 40px rgba(255, 68, 68, 0.6);
    }
    50% { 
        opacity: 0.3;
        text-shadow: 0 0 5px rgba(255, 68, 68, 0.3);
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.5px;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: transparent;
    color: var(--primary);
    box-shadow: 0 0 20px var(--glow-primary), inset 0 0 20px var(--glow-primary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--bg);
    box-shadow: 0 0 20px var(--glow-primary);
    transform: translateY(-2px);
}

/* Better focus states */
.btn:focus,
button:focus,
input:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: bounce 2.scrolls infinite;
}

-indicator span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(10px);
    }
    60% {
        transform: translateY(5px);
    }
}

/* Section Styles */
section {
    padding: 6rem 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: var(--primary);
    text-shadow: 0 0 10px var(--glow-primary);
}

/* About Section */
.about {
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 65, 0.02), transparent);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-dim);
    font-size: 1.1rem;
}

.about-skills h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.skill-item {
    padding: 1rem;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid rgba(0, 255, 65, 0.2);
    font-size: 0.9rem;
    color: var(--primary);
    text-align: center;
    transition: var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
}

.skill-item.visible {
    animation: fadeInUp 0.6s ease-out forwards;
}

.skill-item:nth-child(1) { animation-delay: 0.1s; }
.skill-item:nth-child(2) { animation-delay: 0.15s; }
.skill-item:nth-child(3) { animation-delay: 0.2s; }
.skill-item:nth-child(4) { animation-delay: 0.25s; }
.skill-item:nth-child(5) { animation-delay: 0.3s; }
.skill-item:nth-child(6) { animation-delay: 0.35s; }
.skill-item:nth-child(7) { animation-delay: 0.4s; }
.skill-item:nth-child(8) { animation-delay: 0.45s; }

.skill-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--primary);
    transition: width 1s ease-out 0.5s;
}

.skill-item.visible::after {
    width: 90%;
}

.skill-item:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
    transform: translateY(-2px);
}

/* Projects Section */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-btn:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--glow-primary);
}

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

.project-card {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(0, 255, 65, 0.1);
    padding: 2rem;
    position: relative;
    transition: var(--transition);
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card.hidden {
    display: none;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.project-card:hover {
    border-color: rgba(0, 255, 65, 0.3);
    box-shadow: 0 10px 40px rgba(0, 255, 65, 0.1);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-number {
    font-size: 4rem;
    font-weight: 700;
    color: rgba(0, 255, 65, 0.1);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    line-height: 1;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.project-description {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 0.95rem;
}

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

.project-tech span {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    background: rgba(0, 255, 65, 0.1);
    color: var(--primary);
    border-radius: 2px;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.project-link:hover {
    text-shadow: 0 0 10px var(--glow-primary);
    margin-left: 5px;
}

/* Stagger Animation for Project Cards */
.project-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Contact Section */
.contact {
    background: linear-gradient(to top, transparent, rgba(0, 255, 65, 0.02), transparent);
}

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

.contact-info p {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text);
    text-decoration: none;
    padding: 1rem;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.1);
    transition: var(--transition);
}

.contact-link:hover {
    border-color: var(--primary);
    background: rgba(0, 255, 65, 0.05);
    transform: translateX(10px);
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.2);
    color: var(--text);
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
}

.form-group input.error,
.form-group textarea.error {
    border-color: #FF4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.2);
}

.form-group input.success,
.form-group textarea.success {
    border-color: #00E5FF;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.form-error {
    color: #FF4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.form-group input.error ~ .form-error,
.form-group textarea.error ~ .form-error {
    display: block;
}

.form-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
    font-size: 1rem;
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--primary);
    background: var(--bg-dark);
    padding: 0 0.5rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form .btn {
    align-self: flex-start;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(0, 255, 65, 0.1);
    background: rgba(5, 5, 5, 0.5);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.terminal-trigger {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

.terminal-trigger kbd {
    background: rgba(0, 229, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    font-family: var(--font-mono);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(0, 229, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: var(--bg);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 5px 20px var(--glow-primary);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--glow-primary);
}

/* Terminal Interface */
.terminal-interface {
    position: fixed;
    bottom: -400px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    height: 400px;
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid var(--primary);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -5px 30px rgba(0, 229, 255, 0.3);
    z-index: 9999;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-mono);
}

.terminal-interface.active {
    bottom: 0;
}

.terminal-header {
    background: rgba(0, 229, 255, 0.1);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    color: var(--primary);
    font-size: 0.9rem;
}

.terminal-close {
    background: none;
    border: none;
    color: #FF4444;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.terminal-close:hover {
    transform: scale(1.2);
    text-shadow: 0 0 10px #FF4444;
}

.terminal-body {
    padding: 1rem;
    height: calc(100% - 50px);
    display: flex;
    flex-direction: column;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    color: var(--text);
}

.terminal-line {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.terminal-line.success { color: #00E5FF; }
.terminal-line.error { color: #FF4444; }
.terminal-line.warning { color: #FFA500; }

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-prompt {
    color: var(--primary);
    font-weight: 600;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
}

.terminal-input::placeholder {
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 968px) {
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Better touch targets for tablets */
    .btn {
        min-height: 48px;
        padding: 1rem 2rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 768px) {
    /* Mobile navigation improvements */
    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(10, 10, 20, 0.98);
        backdrop-filter: blur(20px);
        padding: 2rem 1.5rem;
        flex-direction: column;
        gap: 0;
        border-top: 1px solid rgba(0, 229, 255, 0.2);
        z-index: 999;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        list-style: none;
        margin: 0;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
    
    .nav-menu li {
        width: 100%;
        margin: 0;
    }
    
    .nav-link {
        font-size: 1.25rem;
        padding: 1rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(0, 229, 255, 0.1);
    }
    
    .nav-controls {
        order: 2;
        gap: 0.75rem;
    }
    
    .nav-controls button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .nav-toggle {
        display: flex;
        order: 3;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Hero section mobile optimization */
    .hero {
        min-height: calc(100vh - 70px);
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: none;
        text-align: center;
        justify-content: center;
    }
    
    /* Sections mobile spacing */
    section {
        padding: 3rem 0;
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    /* Projects grid mobile */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-card {
        padding: 2rem 1.5rem;
    }
    
    .project-number {
        font-size: 4rem;
        opacity: 0.3;
    }
    
    .project-title {
        font-size: 1.5rem;
    }
    
    .project-link {
        font-size: 0.9rem;
    }
    
    /* Skills grid mobile */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .skill-item {
        padding: 1rem;
    }
    
    /* Contact form mobile */
    .contact-form {
        padding: 2rem 1.5rem;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Settings panel mobile */
    .settings-panel {
        width: 100%;
        max-width: 100vw;
        right: -100%;
        border-radius: 0;
        height: 100vh;
        overflow-y: auto;
    }
    
    .settings-panel.active {
        right: 0 !important;
    }
    
    /* Terminal mobile */
    .terminal-interface {
        width: 95vw;
        height: 70vh;
        max-height: 500px;
    }
    
    /* Preloader mobile */
    .preloader-logo {
        font-size: 1.5rem;
    }
    
    /* Breadcrumb mobile */
    .breadcrumb {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    /* Toast mobile */
    .toast {
        width: calc(100% - 2rem);
        max-width: none;
        left: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    :root {
        font-size: 14px;
    }
    
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .nav-container {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }
    
    .nav {
        height: 60px;
    }
    
    .nav-logo {
        font-size: 1.1rem;
    }
    
    .nav-controls {
        gap: 0.5rem;
    }
    
    .nav-controls button {
        min-width: 40px;
        min-height: 40px;
        font-size: 0.9rem;
    }
    
    /* Hero ultra mobile */
    .hero {
        padding: 2rem 1rem 1.5rem;
        min-height: calc(100vh - 60px);
        justify-content: flex-start;
        padding-top: 25vh;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 10vw, 2.2rem);
        margin-bottom: 0.75rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
        max-width: 90%;
    }
    
    .hero-cta {
        width: 100%;
        max-width: 300px;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Project cards compact */
    .project-card {
        padding: 1.25rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .project-number {
        font-size: 2.5rem;
        top: 5px;
        right: 5px;
        opacity: 0.2;
    }
    
    .project-title {
        font-size: 1.15rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }
    
    .project-description {
        font-size: 0.85rem;
        margin-bottom: 0.85rem;
        line-height: 1.5;
    }
    
    .project-tech {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .project-tech span {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }
    
    .project-link {
        font-size: 0.85rem;
        margin-top: 0.75rem;
    }
    
    /* Skills ultra compact */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .skill-item {
        padding: 0.75rem;
    }
    
    .skill-name {
        font-size: 0.9rem;
    }
    
    /* Contact form compact */
    .contact-form {
        padding: 1.25rem 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn-primary {
        padding: 0.85rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Contact links */
    .contact-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .contact-icon {
        font-size: 1.25rem;
    }
    
    /* Terminal ultra mobile */
    .terminal-interface {
        width: 100vw;
        height: 60vh;
        max-height: 400px;
        border-radius: 0;
    }
    
    .terminal-header {
        padding: 0.5rem 1rem;
    }
    
    .terminal-output {
        font-size: 0.75rem;
        padding: 0.75rem;
    }
    
    .terminal-input-line input {
        font-size: 0.85rem;
    }
    
    /* Custom cursor disable on mobile */
    .custom-cursor,
    .custom-cursor-trail {
        display: none !important;
    }
    
    body {
        cursor: auto !important;
    }
    
    /* Back to top button mobile */
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
        font-size: 1.25rem;
    }
    
    /* Music indicator mobile */
    .music-indicator {
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Settings panel ultra mobile */
    .settings-panel h3 {
        font-size: 1.25rem;
    }
    
    .setting-group label {
        font-size: 0.9rem;
    }
    
    .setting-value {
        font-size: 0.85rem;
    }
}

/* Landscape mobile phones */
@media (max-width: 896px) and (max-height: 414px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .hero-cta {
        flex-direction: row;
        gap: 1rem;
    }
    
    .btn {
        width: auto;
        padding: 0.75rem 1.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    .nav-link,
    .project-link,
    .contact-link,
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .project-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    /* Tap highlight color */
    * {
        -webkit-tap-highlight-color: rgba(0, 229, 255, 0.2);
    }
}

/* Animations for scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Selection styling */
::selection {
    background: var(--primary);
    color: var(--bg-dark);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--matrix-green-dim);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
