/* ============================================
   Victor.Chen Portfolio — Style System
   Dual themes: Minimal (black/white) & Neon (dark gradient)
   ============================================ */

/* ---- Theme Variables ---- */
[data-theme="minimal"] {
    --bg-primary: #FAFAFA;
    --bg-secondary: #F2F2F2;
    --bg-tertiary: #EBEBEB;
    --text-primary: #0A0A0A;
    --text-secondary: #525252;
    --text-tertiary: #8A8A8A;
    --accent: #0A0A0A;
    --accent-text: #FAFAFA;
    --card-bg: #FFFFFF;
    --card-border: #E5E5E5;
    --card-hover-border: #0A0A0A;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.04);
    --card-hover-shadow: 0 8px 30px rgba(0,0,0,0.08);
    --tag-bg: #F0F0F0;
    --tag-text: #333333;
    --tag-border: transparent;
    --stat-bg: #FFFFFF;
    --stat-border: #E5E5E5;
    --btn-secondary-bg: transparent;
    --btn-secondary-border: #0A0A0A;
    --btn-secondary-text: #0A0A0A;
    --divider: #E5E5E5;
    --badge-bg: rgba(0,0,0,0.05);
    --badge-text: #0A0A0A;
    --badge-dot: #22C55E;
    --footer-bg: #F2F2F2;
    --hero-bg: #FAFAFA;
    --gradient-hero: none;
    --glow-color: transparent;
    --oss-card-bg: #FFFFFF;
    --oss-card-hover-bg: #F8F8F8;
    --code-font: 'JetBrains Mono', monospace;
    --mono-accent: #0A0A0A;
}

[data-theme="neon"] {
    --bg-primary: #06060E;
    --bg-secondary: #0C0C1A;
    --bg-tertiary: #12122A;
    --text-primary: #EEEEEE;
    --text-secondary: #9CA3AF;
    --text-tertiary: #6B7280;
    --accent: #8B5CF6;
    --accent-text: #FFFFFF;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-border: rgba(139, 92, 246, 0.4);
    --card-shadow: 0 0 0 1px rgba(255,255,255,0.03);
    --card-hover-shadow: 0 0 40px rgba(139, 92, 246, 0.12), 0 0 80px rgba(6, 182, 212, 0.06);
    --tag-bg: rgba(139, 92, 246, 0.1);
    --tag-text: #C4B5FD;
    --tag-border: rgba(139, 92, 246, 0.2);
    --stat-bg: rgba(255, 255, 255, 0.03);
    --stat-border: rgba(255, 255, 255, 0.06);
    --btn-secondary-bg: rgba(139, 92, 246, 0.1);
    --btn-secondary-border: rgba(139, 92, 246, 0.3);
    --btn-secondary-text: #C4B5FD;
    --divider: rgba(255, 255, 255, 0.06);
    --badge-bg: rgba(139, 92, 246, 0.1);
    --badge-text: #C4B5FD;
    --badge-dot: #8B5CF6;
    --footer-bg: #06060E;
    --hero-bg: #06060E;
    --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent);
    --glow-color: rgba(139, 92, 246, 0.2);
    --oss-card-bg: rgba(255, 255, 255, 0.02);
    --oss-card-hover-bg: rgba(139, 92, 246, 0.08);
    --code-font: 'JetBrains Mono', monospace;
    --mono-accent: #8B5CF6;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---- Theme Switcher ---- */
.theme-switcher {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    padding: 4px;
    z-index: 100;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

[data-theme="neon"] .theme-switcher {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--code-font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.theme-btn.active {
    background: var(--accent);
    color: var(--accent-text);
}

.theme-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    transition: background 0.3s ease;
}

.theme-btn.active .theme-dot {
    background: var(--accent-text);
}

/* ---- Hero Section ---- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hero-bg);
    position: relative;
    overflow: hidden;
}

[data-theme="neon"] .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    pointer-events: none;
}

/* Neon: animated gradient orbs */
[data-theme="neon"] .hero::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08), transparent 70%);
    top: -200px;
    right: -200px;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, 30px) scale(1.1); }
    66% { transform: translate(30px, -20px) scale(0.95); }
}

.hero-content {
    text-align: center;
    max-width: 720px;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--badge-bg);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--badge-text);
    margin-bottom: 32px;
    font-family: var(--code-font);
    letter-spacing: 0.02em;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--badge-dot);
    animation: pulse 2s ease-in-out infinite;
}

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

.hero-name {
    font-size: clamp(48px, 8vw, 80px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 16px;
    color: var(--text-primary);
}

[data-theme="minimal"] .hero-name {
    font-weight: 900;
}

[data-theme="neon"] .hero-name {
    background: linear-gradient(135deg, #EEEEEE 0%, #8B5CF6 50%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: clamp(14px, 2vw, 18px);
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.tagline-sep {
    margin: 0 8px;
    opacity: 0.4;
}

.hero-desc {
    font-size: 15px;
    color: var(--text-tertiary);
    line-height: 1.7;
    margin-bottom: 28px;
}

/* Tags */
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 36px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--code-font);
    letter-spacing: 0.01em;
    border: 1px solid var(--tag-border);
    transition: all 0.2s ease;
}

[data-theme="neon"] .tag {
    border-color: var(--tag-border);
}

/* Buttons */
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

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

[data-theme="minimal"] .btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
}

[data-theme="neon"] .btn-primary {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

[data-theme="neon"] .btn-primary:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1.5px solid var(--btn-secondary-border);
}

.btn-secondary:hover {
    transform: translateY(-1px);
}

[data-theme="minimal"] .btn-secondary:hover {
    background: var(--accent);
    color: var(--accent-text);
}

[data-theme="neon"] .btn-secondary:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* ---- Stats Section ---- */
.stats {
    background: var(--bg-secondary);
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
    padding: 32px 24px;
}

.stats-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--code-font);
    letter-spacing: -0.02em;
}

[data-theme="neon"] .stat-number {
    background: linear-gradient(135deg, #8B5CF6, #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--divider);
}

/* ---- Section Titles ---- */
.section-title {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 15px;
    margin-bottom: 48px;
}

/* ---- Featured Projects ---- */
.projects {
    padding: 100px 0 60px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.3s ease;
}

[data-theme="neon"] .project-card::before {
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0), transparent);
}

.project-card:hover {
    border-color: var(--card-hover-border);
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-3px);
}

[data-theme="minimal"] .project-card:hover::before {
    background: var(--accent);
}

[data-theme="neon"] .project-card:hover::before {
    background: linear-gradient(90deg, #8B5CF6, #06B6D4);
}

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

.card-icon {
    font-size: 28px;
}

.card-links {
    display: flex;
    gap: 8px;
}

.card-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
}

.card-link:hover {
    color: var(--accent);
    background: var(--tag-bg);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.card-tech span {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--code-font);
    font-weight: 500;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
}

.card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.card-metrics span {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.card-metrics span::before {
    content: '•';
    margin-right: 4px;
    color: var(--accent);
}

[data-theme="neon"] .card-metrics span::before {
    color: #8B5CF6;
}

/* ---- More Projects ---- */
.more-projects {
    padding: 40px 0 80px;
}

.more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .more-grid {
        grid-template-columns: 1fr;
    }
}

.more-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.more-card:hover {
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}

.more-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.more-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* ---- Open Source ---- */
.opensource {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.oss-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .oss-grid {
        grid-template-columns: 1fr;
    }
}

.oss-card {
    display: block;
    background: var(--oss-card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.oss-card:hover {
    background: var(--oss-card-hover-bg);
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}

.oss-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    font-family: var(--code-font);
}

.oss-name svg {
    color: #F59E0B;
    flex-shrink: 0;
}

.oss-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.oss-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: var(--code-font);
}

/* ---- About Section ---- */
.about {
    padding: 100px 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: start;
}

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

.about-text p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 16px;
}

.about-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.highlight {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.highlight-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.highlight strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.highlight p {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* ---- Footer ---- */
.footer {
    padding: 48px 0 32px;
    border-top: 1px solid var(--divider);
    background: var(--footer-bg);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-name {
    font-size: 16px;
    font-weight: 700;
}

.footer-tagline {
    font-size: 13px;
    color: var(--text-tertiary);
}

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

.social-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.25s ease;
}

.social-link:hover {
    border-color: var(--card-hover-border);
    color: var(--text-primary);
    transform: translateY(-1px);
}

[data-theme="neon"] .social-link:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

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

.footer-bottom p {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ---- Animations ---- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animations */
.project-grid .fade-in:nth-child(2) { transition-delay: 0.1s; }
.project-grid .fade-in:nth-child(3) { transition-delay: 0.2s; }
.project-grid .fade-in:nth-child(4) { transition-delay: 0.3s; }

.oss-grid .oss-card:nth-child(2) { transition-delay: 0.05s; }
.oss-grid .oss-card:nth-child(3) { transition-delay: 0.1s; }
.oss-grid .oss-card:nth-child(4) { transition-delay: 0.15s; }
.oss-grid .oss-card:nth-child(5) { transition-delay: 0.2s; }
.oss-grid .oss-card:nth-child(6) { transition-delay: 0.25s; }

/* Neon-specific animations */
[data-theme="neon"] .hero-content {
    filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.1));
}

/* Selection */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: #FFFFFF;
}

[data-theme="minimal"] ::selection {
    background: rgba(10, 10, 10, 0.15);
    color: inherit;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .hero-name {
        font-size: 40px;
    }

    .hero-tagline {
        font-size: 14px;
    }

    .hero-desc {
        font-size: 14px;
    }

    .stats-inner {
        gap: 16px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-divider {
        height: 24px;
    }

    .theme-switcher {
        top: 12px;
        right: 12px;
    }

    .theme-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .social-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .project-card {
        padding: 20px;
    }

    .hero-badge {
        font-size: 11px;
    }

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

/* ---- Scrollbar (Neon only) ---- */
[data-theme="neon"] ::-webkit-scrollbar {
    width: 8px;
}

[data-theme="neon"] ::-webkit-scrollbar-track {
    background: #06060E;
}

[data-theme="neon"] ::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}

[data-theme="neon"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* ---- Print ---- */
@media print {
    .theme-switcher { display: none; }
    .hero { min-height: auto; padding: 40px 0; }
    body { background: white; color: black; }
}
