/* ==========================================
   CSS Variables & Theme Configuration
   ========================================== */
:root {
    /* Dark Mode (Default) */
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: #1a1a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0d0;
    --text-muted: #6a6a8a;
    --accent: #7b68ee;
    --accent-glow: #9370db;
    --accent-bright: #a78bfa;
    --border-color: #2a2a5a;
    --star-color: #ffffff;
    
    /* Pixel borders */
    --pixel-border: 4px solid var(--accent);
    --pixel-shadow: 
        4px 4px 0 var(--accent-glow),
        8px 8px 0 rgba(123, 104, 238, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

[data-theme="light"] {
    --bg-primary: #e8e8ff;
    --bg-secondary: #f0f0ff;
    --bg-card: #ffffff;
    --text-primary: #1a1a3a;
    --text-secondary: #4a4a6a;
    --text-muted: #7a7a9a;
    --accent: #5b48ce;
    --accent-glow: #7b68ee;
    --accent-bright: #8b78fe;
    --border-color: #c0c0e0;
    --star-color: #5b48ce;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Mono', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ==========================================
   Animated Stars Background
   ========================================== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: var(--star-color);
    border-radius: 50%;
    animation: twinkle var(--twinkle-duration, 3s) ease-in-out infinite;
    animation-delay: var(--twinkle-delay, 0s);
}

.star.pixel {
    border-radius: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: var(--star-opacity, 0.3); transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Shooting star */
.shooting-star {
    position: absolute;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-bright), transparent);
    animation: shoot 3s ease-in-out infinite;
    opacity: 0;
}

@keyframes shoot {
    0% { transform: translateX(-100px) translateY(0); opacity: 0; }
    10% { opacity: 1; }
    30% { transform: translateX(calc(100vw + 100px)) translateY(100px); opacity: 0; }
    100% { opacity: 0; }
}

/* ==========================================
   Navigation
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
    z-index: 1000;
    transition: background-color var(--transition-normal);
}

[data-theme="light"] .navbar {
    background: rgba(240, 240, 255, 0.9);
}

.nav-logo {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

.nav-logo:hover {
    color: var(--accent-bright);
    text-shadow: 0 0 20px var(--accent-glow);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link:hover::after {
    width: 100%;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.theme-icon {
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.theme-icon.sun {
    position: absolute;
    opacity: 0;
    transform: translateY(20px) rotate(-90deg);
}

.theme-icon.moon {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

[data-theme="light"] .theme-icon.sun {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

[data-theme="light"] .theme-icon.moon {
    opacity: 0;
    transform: translateY(-20px) rotate(90deg);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
    z-index: 999;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu.active {
    display: flex;
}

.mobile-link {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 1rem;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: all var(--transition-fast);
}

.mobile-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(123, 104, 238, 0.1);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 2rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 600px;
}

/* Profile Container */
.profile-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto 2rem;
    cursor: pointer;
}

.profile-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    animation: pulse-glow 3s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.05); }
}

.profile-ring {
    position: absolute;
    inset: -10px;
    border: 4px solid var(--accent);
    animation: rotate-ring 20s linear infinite;
    z-index: 1;
}

.profile-ring::before,
.profile-ring::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent-bright);
}

.profile-ring::before {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.profile-ring::after {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes rotate-ring {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 4px solid var(--accent);
    position: relative;
    z-index: 2;
    transition: all var(--transition-fast);
    image-rendering: auto;
}

.profile-container:hover .profile-image {
    box-shadow: 0 0 30px var(--accent-glow);
}

/* Pixel Overlay (for click effect) */
.pixel-overlay {
    position: absolute;
    inset: 4px;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.profile-container.glitching .pixel-overlay {
    opacity: 1;
}

/* Portal Effect */
.portal-effect {
    position: absolute;
    inset: -40px;
    border: 4px solid transparent;
    border-radius: 50%;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

.portal-effect.active {
    animation: portal-spiral 1s ease-out forwards;
}

@keyframes portal-spiral {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
        border-color: var(--accent);
        box-shadow: 
            0 0 20px var(--accent),
            inset 0 0 20px var(--accent);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(180deg);
        border-color: var(--accent-bright);
        box-shadow: 
            0 0 40px var(--accent-bright),
            inset 0 0 40px var(--accent-glow);
    }
    100% {
        opacity: 0;
        transform: scale(1.5) rotate(360deg);
        border-color: transparent;
    }
}

/* Glitch Effect */
.glitch-slices {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
}

.profile-container.glitching {
    animation: glitch-shake 0.5s ease-in-out;
}

@keyframes glitch-shake {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-5px, -5px); }
    20% { transform: translate(5px, 5px); }
    30% { transform: translate(-5px, 5px); }
    40% { transform: translate(5px, -5px); }
    50% { transform: translate(-3px, 3px); }
    60% { transform: translate(3px, -3px); }
    70% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
    90% { transform: translate(-1px, 1px); }
}

.profile-container.glitching .profile-image {
    animation: rgb-split 0.5s ease-in-out;
}

@keyframes rgb-split {
    0%, 100% { 
        filter: none;
    }
    25% { 
        filter: 
            drop-shadow(-3px 0 0 rgba(255, 0, 0, 0.5))
            drop-shadow(3px 0 0 rgba(0, 255, 255, 0.5));
    }
    50% { 
        filter: 
            drop-shadow(3px 0 0 rgba(255, 0, 0, 0.7))
            drop-shadow(-3px 0 0 rgba(0, 255, 255, 0.7))
            brightness(1.2);
    }
    75% { 
        filter: 
            drop-shadow(-2px 0 0 rgba(255, 0, 0, 0.5))
            drop-shadow(2px 0 0 rgba(0, 255, 255, 0.5));
    }
}

/* Sparkle particles */
.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-bright);
    pointer-events: none;
    z-index: 10;
    animation: sparkle-float 1s ease-out forwards;
}

@keyframes sparkle-float {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Hero Text */
.hero-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% { filter: drop-shadow(0 0 10px transparent); }
    50% { filter: drop-shadow(0 0 20px var(--accent-glow)); }
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.scroll-hint {
    animation: bounce 2s ease-in-out infinite;
    color: var(--accent);
    font-size: 1.5rem;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ==========================================
   About Section
   ========================================== */
.about {
    min-height: 100vh;
    padding: 6rem 2rem;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-container {
    max-width: 700px;
    width: 100%;
}

.section-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.2em;
}

/* Experience Card */
.experience-card {
    background: var(--bg-card);
    border: 4px solid var(--accent);
    padding: 2rem;
    position: relative;
    box-shadow: var(--pixel-shadow);
    transition: all var(--transition-normal);
}

.experience-card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px dashed var(--border-color);
    pointer-events: none;
}

.experience-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        4px 4px 0 var(--accent-glow),
        8px 8px 0 rgba(123, 104, 238, 0.3),
        12px 12px 0 rgba(123, 104, 238, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.pixel-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 3px solid var(--accent);
}

.card-title-group h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-location {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-content {
    margin-bottom: 1.5rem;
}

.experience-item {
    margin-bottom: 1.5rem;
}

.exp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.exp-company {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: var(--accent-bright);
}

.exp-badge {
    background: var(--accent);
    color: var(--bg-primary);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 0.25rem 0.5rem;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.exp-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 1.5rem 0;
}

.certifications h4,
.focus-areas h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.cert-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cert-tag {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.cert-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.focus-list {
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.focus-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent);
    transition: all var(--transition-fast);
}

.focus-list li:hover {
    color: var(--text-primary);
    padding-left: 1rem;
}

.card-footer {
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
    text-align: center;
}

.cta-button {
    display: inline-block;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: var(--accent);
    text-decoration: none;
    padding: 1rem 1.5rem;
    border: 3px solid var(--accent);
    background: transparent;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: translateX(-100%);
    transition: transform var(--transition-fast);
    z-index: -1;
}

.cta-button:hover {
    color: var(--bg-primary);
}

.cta-button:hover::before {
    transform: translateX(0);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    padding: 2rem;
    border-top: 2px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent);
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-logo {
        font-size: 0.7rem;
    }
    
    .hero-title {
        font-size: 1.3rem;
    }
    
    .hero-subtitle {
        font-size: 0.8rem;
    }
    
    .profile-container {
        width: 220px;
        height: 220px;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .experience-card {
        padding: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .exp-header {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1rem;
    }
    
    .profile-container {
        width: 180px;
        height: 180px;
    }
    
    .card-title-group h3 {
        font-size: 0.65rem;
    }
    
    .exp-company {
        font-size: 0.55rem;
    }
}
