/* ==========================================================================
   RUOYUN.VIP - MODERN CYBERPUNK & GLASSMORPHISM DESIGN SYSTEM
   ========================================================================== */

:root {
    --bg-dark: #07090e;
    --bg-panel: rgba(18, 24, 38, 0.6);
    --bg-panel-hover: rgba(28, 38, 58, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(0, 242, 254, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --accent-purple: #9f55ff;
    --accent-green: #00e676;
    
    --gradient-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --gradient-purple: linear-gradient(135deg, #4facfe 0%, #9f55ff 100%);
    --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    
    --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.25);
    --shadow-panel: 0 20px 40px rgba(0, 0, 0, 0.4);
    
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Noto Sans SC', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    color-scheme: dark;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* --- Interactive Particle Canvas & Ambient Background --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
    animation: floatGlow 20s ease-in-out infinite alternate;
}

.glow-1 {
    top: -100px;
    left: -150px;
    background: var(--accent-blue);
}

.glow-2 {
    bottom: -150px;
    right: -100px;
    background: var(--accent-purple);
    animation-delay: -10s;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, 150px) scale(1.2); }
    100% { transform: translate(-50px, 80px) scale(0.9); }
}

/* --- Glassmorphic Panels & Utility --- */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-panel);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.glass-panel:hover {
    transform: translateY(-6px);
    border-color: var(--border-highlight);
    box-shadow: 0 15px 35px rgba(0, 242, 254, 0.15);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* --- Navigation Bar --- */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(7, 9, 14, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.logo-symbol {
    color: var(--accent-cyan);
    font-size: 1.6rem;
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

.logo-text .highlight {
    color: var(--accent-cyan);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-smooth);
}

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

.blog-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: var(--accent-cyan) !important;
}

.blog-btn:hover {
    background: var(--gradient-primary);
    color: #000 !important;
    box-shadow: var(--shadow-glow);
}

.blog-btn::after {
    display: none;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 50px;
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--accent-green);
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 230, 118, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-smooth);
}

/* --- Main Layout --- */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-subtitle {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.6rem;
    font-weight: 700;
    background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Hero Section --- */
.hero-section {
    min-height: calc(100vh - 80px);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 4rem 0;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1.2rem;
    background: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.typewriter-container {
    font-family: var(--font-code);
    font-size: 1.4rem;
    color: var(--accent-cyan);
    margin-bottom: 1.5rem;
    min-height: 2rem;
    display: flex;
    align-items: center;
}

.code-symbol {
    color: var(--accent-purple);
    margin-right: 0.5rem;
    font-weight: 700;
}

.cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--accent-cyan);
    margin-left: 4px;
    animation: blink 1s infinite;
}

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

.hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.8rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #050811;
    box-shadow: 0 10px 25px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 242, 254, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    transform: translateY(-3px);
}

.btn-ghost {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-3px);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    font-family: var(--font-code);
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    color: var(--text-muted);
}

/* --- Hero Visual & Avatar Card --- */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.avatar-card {
    background: rgba(18, 24, 38, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease-out;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.1) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.avatar-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(0, 242, 254, 0.5);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.3);
    position: relative;
    z-index: 2;
}

.avatar-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px dashed rgba(79, 172, 254, 0.4);
    animation: rotateRing 20s linear infinite;
    z-index: 1;
}

@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.card-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.card-info .role {
    font-family: var(--font-code);
    color: var(--accent-cyan);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.server-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.2rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.spec-label {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.spec-val {
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
}

.floating-badge {
    position: absolute;
    padding: 0.5rem 1rem;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    animation: floatBadge 4s ease-in-out infinite;
}

.badge-top-right {
    top: 20px;
    right: -20px;
    border-color: rgba(0, 230, 118, 0.4);
    color: var(--accent-green);
}

.badge-bottom-left {
    bottom: 30px;
    left: -20px;
    border-color: rgba(0, 242, 254, 0.4);
    color: var(--accent-cyan);
    animation-delay: -2s;
}

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

/* --- About Me Grid --- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.about-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
}

.about-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #fff;
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- Tech Matrix Grid --- */
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.matrix-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

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

.matrix-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.skill-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.skill-name {
    display: block;
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.skill-bar {
    display: block;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.skill-bar .fill {
    display: block;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* --- Project Laboratory Grid --- */
.filter-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.filter-btn {
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--gradient-primary);
    color: #050811;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.25);
}

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

.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-tag {
    font-family: var(--font-code);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.metric {
    font-family: var(--font-code);
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 6px;
    color: #fff;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.2rem;
    font-family: var(--font-code);
    font-size: 0.85rem;
}

.project-domain {
    color: var(--text-muted);
}

.project-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.project-link:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--accent-cyan);
}

.status-green {
    color: var(--accent-green);
    font-weight: 600;
}

/* --- Timeline Section --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-cyan) 0%, rgba(255,255,255,0.05) 100%);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 13px;
    top: 30px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-cyan);
}

.timeline-date {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    display: block;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #fff;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- Contact Section --- */
.contact-section {
    padding: 4rem 0 6rem;
}

.contact-card {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(18, 24, 38, 0.8) 0%, rgba(30, 41, 65, 0.6) 100%);
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: 0 0 50px rgba(0, 242, 254, 0.1);
}

.contact-info h2 {
    font-size: 2.2rem;
    margin: 1rem 0;
    color: #fff;
}

.contact-info p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
}

.contact-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.btn-large {
    padding: 1rem 2.2rem;
    font-size: 1.1rem;
}

/* --- Footer --- */
.footer {
    background: #04060a;
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-left p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.footer-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

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

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-primary);
    color: #000;
    font-weight: 700;
    padding: 1rem 1.8rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.4);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 968px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-desc {
        margin: 0 auto 2.5rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .typewriter-container {
        justify-content: center;
    }

    .tech-tags {
        justify-content: center;
    }

    .avatar-card {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(7, 9, 14, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

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

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

    .lab-grid, .matrix-grid, .about-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-specs {
        justify-content: center;
    }
}
