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

:root {
    /* Dark Mode Colors (Default) */
    --background: #0B0C10;
    --background-secondary: #1F2833;
    --text-color: #C5C6C7;
    --accent-primary: #45A29E;
    --accent-glow: #66FCF1;
    --surface: rgba(31, 40, 51, 0.5);
    --surface-border: rgba(102, 252, 241, 0.2);
    --planet-gradient-1: #66FCF1;
    --planet-gradient-2: #45A29E;
    --planet-gradient-3: #1F2833;
    --shadow-glow: rgba(102, 252, 241, 0.4);
    --cursor-color: #66FCF1;
    --star-color: white;
}

[data-theme="light"] {
    /* Light Mode Colors */
    --background: #F7F8FA;
    --background-secondary: #E7F1FB;
    --text-color: #2C3E50;
    --accent-primary: #7B68EE;
    --accent-glow: #A0C4FF;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-border: rgba(160, 196, 255, 0.3);
    --planet-gradient-1: #A0C4FF;
    --planet-gradient-2: #C8B6FF;
    --planet-gradient-3: #E7F1FB;
    --shadow-glow: rgba(123, 104, 238, 0.3);
    --cursor-color: #7B68EE;
    --star-color: #A0C4FF;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, var(--background) 0%, var(--background-secondary) 100%);
    color: var(--text-color);
    overflow-x: hidden;
    cursor: none;
    transition: background 0.5s ease, color 0.5s ease;
}

/* Custom Cursor */
.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--cursor-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: all 0.1s ease, border-color 0.5s ease;
    mix-blend-mode: difference;
}

.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--cursor-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    animation: trailFade 0.8s ease-out forwards;
    transition: background 0.5s ease;
}

@keyframes trailFade {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.3); }
}

/* Starfield Background */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: opacity 0.5s ease;
}

.star {
    position: absolute;
    background: var(--star-color);
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
    transition: background 0.5s ease;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Theme Toggle Button */
.theme-toggle {
    width: 50px;
    height: 50px;
    background: var(--surface);
    border: 2px solid var(--accent-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--shadow-glow);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 0 30px var(--shadow-glow);
}

.theme-icon {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(11, 12, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--surface-border);
    transition: background 0.5s ease, border-color 0.5s ease;
}

[data-theme="light"] nav {
    background: rgba(247, 248, 250, 0.8);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-glow);
    text-shadow: 0 0 20px var(--accent-glow);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

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

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

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

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

.hero-bg {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50%;
    background: radial-gradient(ellipse at bottom, var(--shadow-glow) 0%, transparent 70%);
    transition: background 0.5s ease;
}

.astronaut {
    position: absolute;
    bottom: 10%;
    right: 15%;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--planet-gradient-3), var(--planet-gradient-2));
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 0 60px var(--shadow-glow);
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

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

.mission-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 4px;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s forwards 0.5s;
    transition: color 0.5s ease;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s forwards 0.8s;
    filter: drop-shadow(0 0 20px var(--shadow-glow));
    transition: filter 0.5s ease;
}

.cta-button {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    color: var(--background);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 0 30px var(--shadow-glow);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 1s forwards 1.1s;
    position: relative;
    overflow: hidden;
}

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

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 50px var(--shadow-glow);
}

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

/* About Section */
.about {
    position: relative;
    padding: 8rem 5%;
    background: linear-gradient(180deg, var(--background) 0%, var(--background-secondary) 100%);
    transition: background 0.5s ease;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--accent-glow);
    text-shadow: 0 0 20px var(--accent-glow);
    position: relative;
    transition: all 0.5s ease;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.mission-log {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface);
    padding: 3rem;
    border-radius: 20px;
    border: 2px solid var(--surface-border);
    box-shadow: 0 0 40px var(--shadow-glow);
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
}

.mission-log h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    transition: color 0.5s ease;
}

.mission-log p {
    line-height: 1.8;
    margin-bottom: 2rem;
}

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

.stat-card {
    text-align: center;
    padding: 2rem;
    background: rgba(69, 162, 158, 0.1);
    border-radius: 15px;
    border: 1px solid var(--accent-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--shadow-glow);
}

.stat-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: var(--accent-glow);
    margin-bottom: 0.5rem;
    transition: color 0.5s ease;
}

.stat-label {
    color: var(--text-color);
    font-size: 0.9rem;
    transition: color 0.5s ease;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.skill-badge {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    color: var(--background);
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 0 15px var(--shadow-glow);
    animation: pulse 2s infinite;
    transition: all 0.5s ease;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 15px var(--shadow-glow); }
    50% { box-shadow: 0 0 25px var(--shadow-glow); }
}

/* Portfolio Section */
.portfolio {
    position: relative;
    padding: 8rem 5%;
    background: var(--background);
    transition: background 0.5s ease;
}

.planets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    perspective: 1000px;
}

.planet {
    position: relative;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    background: radial-gradient(circle at 30% 30%, var(--planet-gradient-1), var(--planet-gradient-2), var(--planet-gradient-3));
    box-shadow: 0 0 40px var(--shadow-glow),
                inset -20px -20px 50px rgba(0, 0, 0, 0.3);
    animation: gentleRotate 20s linear infinite;
    transition: all 0.5s ease;
    transform-style: preserve-3d;
}

@keyframes gentleRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.planet:hover {
    animation-play-state: paused;
    transform: scale(1.1);
    box-shadow: 0 0 80px var(--shadow-glow),
                0 20px 60px var(--shadow-glow),
                inset -20px -20px 50px rgba(0, 0, 0, 0.2);
}

.planet-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.planet:hover .planet-content {
    opacity: 1;
}

.planet-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--background);
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.planet-desc {
    font-size: 0.9rem;
    color: var(--background);
    opacity: 0.9;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

/* Planet Tooltip */
.planet-tooltip {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 2px solid var(--accent-glow);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, top 0.3s ease;
    box-shadow: 0 0 30px var(--shadow-glow);
    backdrop-filter: blur(10px);
    z-index: 10;
    white-space: nowrap;
}

.planet:hover .planet-tooltip {
    opacity: 1;
    top: -100px;
}

.planet-tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--accent-glow);
}

/* Contact Section */
.contact {
    position: relative;
    padding: 8rem 5%;
    background: linear-gradient(180deg, var(--background) 0%, var(--background-secondary) 100%);
    transition: background 0.5s ease;
}

.cockpit-panel {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface);
    padding: 4rem;
    border-radius: 30px;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 60px var(--shadow-glow);
    position: relative;
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
}

.cockpit-panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-glow), var(--accent-primary), var(--accent-glow));
    border-radius: 30px;
    z-index: -1;
    opacity: 0.3;
    animation: borderGlow 3s linear infinite;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-glow);
    font-family: 'Orbitron', sans-serif;
    transition: color 0.5s ease;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(11, 12, 16, 0.8);
    border: 2px solid var(--accent-primary);
    border-radius: 10px;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
    background: rgba(255, 255, 255, 0.9);
}

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

.submit-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    color: var(--background);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px var(--shadow-glow);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px var(--shadow-glow);
}

.social-orbit {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
}

.social-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--background);
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--shadow-glow);
    animation: float 3s ease-in-out infinite;
}

.social-icon:nth-child(2) {
    animation-delay: 1s;
}

.social-icon:nth-child(3) {
    animation-delay: 2s;
}

.social-icon:hover {
    transform: scale(1.2) rotate(360deg);
    box-shadow: 0 0 40px var(--shadow-glow);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--accent-glow);
    border-radius: 25px;
    opacity: 0;
    animation: fadeIn 1s forwards 1.5s;
    transition: border-color 0.5s ease;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-glow);
    border-radius: 50%;
    animation: scroll 2s infinite;
    transition: background 0.5s ease;
}

@keyframes scroll {
    0% { top: 8px; opacity: 1; }
    100% { top: 32px; opacity: 0; }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .planet {
        animation: none;
    }
    
    .astronaut {
        animation: none;
    }
    
    .social-icon {
        animation: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
    }

    .theme-toggle {
        width: 45px;
        height: 45px;
    }

    .nav-content {
        gap: 1rem;
    }

    .astronaut {
        width: 120px;
        height: 120px;
        bottom: 5%;
        right: 5%;
    }

    .planets-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .mission-log,
    .cockpit-panel {
        padding: 2rem;
    }
}