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

:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #a78bfa;
    --card-bg: #151515;
    --success: #43e97b;
    --error: #ff6b6b;
}

[data-theme="light"] {
    --primary-bg: #ffffff;
    --secondary-bg: #f5f5f5;
    --text-primary: #0a0a0a;
    --text-secondary: #666666;
    --card-bg: #fafafa;
    --accent: #007aff;
    --accent-secondary: #0051d5;
    --accent-tertiary: #5ac8fa;
}

/* Custom Selection */
::selection {
    background: var(--accent);
    color: white;
}

::-moz-selection {
    background: var(--accent);
    color: white;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Cursor */
.cursor-follower {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    mix-blend-mode: difference;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

body:hover .cursor-follower {
    opacity: 0.8;
}

a:hover ~ .cursor-follower,
button:hover ~ .cursor-follower,
.project-card:hover ~ .cursor-follower,
input:hover ~ .cursor-follower,
textarea:hover ~ .cursor-follower {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0.5;
}

a:active ~ .cursor-follower,
button:active ~ .cursor-follower {
    transform: translate(-50%, -50%) scale(0.8);
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
    pointer-events: none;
    z-index: 0;
}

/* Grid Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* All content above background */
header, section, footer {
    position: relative;
    z-index: 1;
}

/* Header Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    transition: width 0.3s ease;
}

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

.nav-links a:hover {
    color: var(--accent);
}

/* Theme Toggle Switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(21, 21, 21, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "🌙";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 2px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(24px);
    content: "☀️";
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.slider:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

/* Glass Card */
.glass-card {
    background: rgba(21, 21, 21, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 2rem;
}

/* Contact Page */
.contact-page {
    min-height: 100vh;
    padding: 8rem 2rem 4rem;
}

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

.contact-page h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 300;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-tertiary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

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

.contact-method {
    padding: 1.5rem;
}

.contact-method .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.contact-method h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.copy-email {
    background: none;
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.copy-email:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent);
}

.tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.copy-email:hover .tooltip {
    opacity: 1;
}

.social-links-contact {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    padding: 0.8rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* Contact Form */
.contact-form-container h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.error-message {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    display: none;
}

.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.submit-btn .loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.submit-btn.loading span {
    display: none;
}

.submit-btn.loading .loader {
    display: block;
}

.submit-btn.success {
    background: var(--success);
}

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

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid var(--accent);
    white-space: nowrap;
    animation: typing 2s steps(20, end), blink-caret 0.75s step-end infinite;
    display: inline-block;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--accent);
    }
}

/* Responsive */
@media (max-width: 968px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    nav {
        padding: 1rem 2rem;
    }
    
    .cursor-follower,
    .cursor-dot {
        display: none !important;
    }
}

