:root {
    /* Dark mode colors (default) - Black & White Theme */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --text-primary: #ffffff;
    --text-secondary: #d0d0d0;
    --text-muted: #a0a0a0;
    --accent-primary: #ffffff;
    --accent-secondary: #e0e0e0;
    --accent-gradient: linear-gradient(135deg, #ffffff 0%, #d0d0d0 100%);
    --border-color: #333333;
    --terminal-bg: #000000;
    --terminal-border: #333333;
    --card-bg: #0a0a0a;
    --card-hover: #141414;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #000000;
    --text-secondary: #1a1a1a;
    --text-muted: #4a4a4a;
    --accent-primary: #000000;
    --accent-secondary: #1a1a1a;
    --accent-gradient: linear-gradient(135deg, #000000 0%, #333333 100%);
    --border-color: #d0d0d0;
    --terminal-bg: #ffffff;
    --terminal-border: #d0d0d0;
    --card-bg: #f5f5f5;
    --card-hover: #e8e8e8;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Fira Code', 'Courier New', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Retro CRT Scanlines Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9998;
    opacity: 0.3;
}

/* CRT Screen Flicker */
@keyframes flicker {
    0% { opacity: 0.98; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
    z-index: 9997;
    animation: flicker 4s infinite;
}

/* Custom Retro Cursor */
.cursor {
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: all 0.05s ease;
    image-rendering: pixelated;
}

.cursor-follower {
    width: 32px;
    height: 32px;
    border: 2px solid var(--accent-primary);
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: all 0.2s ease;
}

/* Hide all default cursors */
*, *::before, *::after {
    cursor: none !important;
}

/* Mobile: Show default cursor */
@media (max-width: 768px) {
    body, *, *::before, *::after {
        cursor: auto !important;
    }
    .cursor, .cursor-follower {
        display: none;
    }

    /* Fix theme toggle hover state on mobile */
    .theme-toggle:hover {
        transform: none;
    }

    .theme-toggle:active {
        transform: scale(0.95);
    }
}

/* Theme Toggle - Retro Style */
.theme-toggle {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    clip-path: polygon(
        10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%
    );
}

.theme-toggle:hover {
    transform: scale(1.15) rotate(5deg);
    border-color: var(--accent-primary);
}

.theme-toggle .sun-icon {
    display: none;
    color: var(--accent-primary);
}

.theme-toggle .moon-icon {
    display: block;
    color: var(--accent-primary);
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--border-color);
    z-index: 999;
    padding: 20px 0;
}

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

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

.logo {
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    color: var(--accent-primary);
}

.terminal-prompt {
    color: var(--accent-primary);
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

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

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Terminal Window */
.terminal-window {
    background: var(--terminal-bg);
    border: 3px solid var(--terminal-border);
    overflow: hidden;
    clip-path: polygon(
        0% 5%, 5% 0%, 95% 0%, 100% 5%,
        100% 95%, 95% 100%, 5% 100%, 0% 95%
    );
}

.terminal-header {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

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

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-button.close {
    background: #ff5f56;
}

.terminal-button.minimize {
    background: #ffbd2e;
}

.terminal-button.maximize {
    background: #27c93f;
}

.terminal-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.terminal-body {
    padding: 24px;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    min-height: 200px;
}

.terminal-line {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.terminal-command {
    color: var(--text-primary);
}

.cursor-blink {
    color: var(--accent-primary);
    animation: blink 1s infinite;
}

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

.terminal-output {
    margin-top: 16px;
}

.output-line {
    margin: 8px 0;
    color: var(--text-secondary);
}

.output-line.highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Hero Text */
.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.gradient-text {
    color: var(--accent-primary);
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.btn {
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--bg-secondary);
    color: var(--accent-primary);
    border: 3px solid var(--accent-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-secondary);
    border: 3px solid var(--accent-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-secondary:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary);
}

.hero-stats {
    display: flex;
    gap: 48px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
}

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

/* Sections */
.section {
    padding: 100px 0;
}

.section-header {
    margin-bottom: 60px;
}

.section-title {
    font-family: 'Fira Code', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* About Section */
.about-content {
    max-width: 1000px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 60px;
    align-items: start;
}

.profile-section {
    position: sticky;
    top: 120px;
}

.profile-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid var(--border-color);
    padding: 8px;
    background: var(--card-bg);
    clip-path: polygon(
        10px 0%, calc(100% - 10px) 0%, 100% 10px,
        100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%,
        0% calc(100% - 10px), 0% 10px
    );
    transition: all 0.3s ease;
}

.profile-image-wrapper:hover {
    transform: translateY(-4px);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.profile-image-wrapper:hover .profile-image {
    filter: grayscale(0%);
}

@media (max-width: 900px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .profile-section {
        position: relative;
        top: 0;
    }

    .profile-image-wrapper {
        max-width: 300px;
        margin: 0 auto;
    }
}

.about-intro {
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.highlight-item {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
    clip-path: polygon(
        10px 0%, calc(100% - 10px) 0%, 100% 10px,
        100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%,
        0% calc(100% - 10px), 0% 10px
    );
}

.highlight-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.highlight-icon {
    font-size: 2rem;
}

.highlight-item strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.highlight-item p {
    margin: 0;
    font-size: 0.95rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.skill-category {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    padding: 28px;
    transition: all 0.3s ease;
    clip-path: polygon(
        8px 0%, calc(100% - 8px) 0%, 100% 8px,
        100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%,
        0% calc(100% - 8px), 0% 8px
    );
}

.skill-category:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.skill-category-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.skill-item:hover {
    background: var(--card-hover);
    padding-left: 16px;
}

.skill-name {
    color: var(--text-primary);
}

.skill-level {
    color: var(--accent-primary);
    font-size: 0.85rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.project-card {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    padding: 28px;
    transition: all 0.3s ease;
    position: relative;
    clip-path: polygon(
        0% 10px, 10px 0%, calc(100% - 10px) 0%, 100% 10px,
        100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0% calc(100% - 10px)
    );
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
}

.project-card.featured {
    border-color: var(--accent-primary);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.project-tag {
    font-size: 0.85rem;
    padding: 4px 12px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-stats {
    display: flex;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    border-color: var(--accent-primary);
}

.project-links {
    display: flex;
    gap: 16px;
}

.project-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link:hover {
    color: var(--accent-secondary);
}

.view-more {
    text-align: center;
}

/* Experience Section */
.timeline {
    position: relative;
    padding-left: 40px;
}

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

.timeline-item {
    position: relative;
    margin-bottom: 60px;
}

.timeline-dot {
    position: absolute;
    left: -47px;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border: 4px solid var(--bg-primary);
}

.timeline-content {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    padding: 28px;
    transition: all 0.3s ease;
    clip-path: polygon(
        10px 0%, calc(100% - 10px) 0%, 100% 10px,
        100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%,
        0% calc(100% - 10px), 0% 10px
    );
}

.timeline-content:hover {
    transform: translateX(8px);
    border-color: var(--accent-primary);
}

.timeline-date {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--accent-primary);
    margin-bottom: 12px;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.timeline-company {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.timeline-list {
    list-style: none;
    margin-bottom: 16px;
}

.timeline-list li {
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.timeline-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.company-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.company-link:hover {
    color: var(--accent-secondary);
}

/* Contact Section */
.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.contact-item {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
    clip-path: polygon(
        10px 0%, calc(100% - 10px) 0%, 100% 10px,
        100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%,
        0% calc(100% - 10px), 0% 10px
    );
    overflow: hidden;
}

.contact-item > div {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.contact-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.contact-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.contact-item strong {
    display: block;
    margin-bottom: 4px;
}

.contact-item a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    word-break: break-all;
    overflow-wrap: break-word;
}

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

.contact-item p {
    margin: 0;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 48px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    clip-path: polygon(
        8px 0%, calc(100% - 8px) 0%, 100% 8px,
        100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%,
        0% calc(100% - 8px), 0% 8px
    );
}

.social-link:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.social-link svg {
    color: var(--accent-primary);
}

.contact-cta {
    text-align: center;
    padding: 40px;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    clip-path: polygon(
        15px 0%, calc(100% - 15px) 0%, 100% 15px,
        100% calc(100% - 15px), calc(100% - 15px) 100%, 15px 100%,
        0% calc(100% - 15px), 0% 15px
    );
}

.contact-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.contact-tagline {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.contact-tagline strong {
    color: var(--accent-primary);
}

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

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

.footer-text {
    font-family: 'Fira Code', monospace;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .nav-links {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 100px 0 60px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-stats {
        gap: 32px;
    }

    .section {
        padding: 60px 0;
    }

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

    .nav-links {
        display: none;
    }

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

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .social-links {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .terminal-body {
        font-size: 0.85rem;
        padding: 16px;
    }
}

/* Additional Retro Effects */
.hero-title, .section-title {
    animation: glitch 5s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 1px);
    }
    94% {
        transform: translate(2px, -1px);
    }
    96% {
        transform: translate(-1px, 2px);
    }
}

/* Retro Grid Background (subtle) */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* Link hover effects */
.project-link, .company-link {
    position: relative;
    overflow: hidden;
}

.project-link::before, .company-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    transition: left 0.3s ease;
    opacity: 0.1;
    z-index: -1;
}

.project-link:hover::before, .company-link:hover::before {
    left: 0;
}

/* Skill item hover effect */
.skill-item:hover {
    background: var(--card-hover);
    padding-left: 16px;
}

/* Button click animation */
.btn:active {
    transform: scale(0.95);
}

/* Add pixelated effect to cursor on mobile fallback */
@media (max-width: 768px) {
    body::before, body::after {
        display: none;
    }
}
