/* ============================================================
   STYLE.CSS — Zijian Ni Portfolio
   Deep-dark tech theme with purple + cyan accents
   ============================================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f2a;
    --bg-card: #12122a;
    --bg-card-hover: #1a1a3a;
    --purple: #A277FF;
    --purple-dim: #7c5cbf;
    --purple-glow: rgba(162, 119, 255, 0.3);
    --cyan: #00D9FF;
    --cyan-dim: #00a5c4;
    --cyan-glow: rgba(0, 217, 255, 0.3);
    --text-primary: #e4e4e7;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: rgba(162, 119, 255, 0.15);
    --glass: rgba(15, 15, 42, 0.8);
    --font-main: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--purple); }

::selection { background: var(--purple); color: #fff; }

img { max-width: 100%; height: auto; }

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

/* === Cursor Glow === */
#cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(162,119,255,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
    will-change: transform;
}

/* === Particle Canvas === */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* === Navigation === */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 16px 0;
    transition: all var(--transition);
    background: transparent;
}

#navbar.scrolled {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

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

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-bracket { color: var(--purple); }
.logo-text { color: var(--cyan); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--purple);
    background: rgba(162, 119, 255, 0.1);
}

.nav-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-mono);
    transition: all var(--transition);
}

.btn-icon:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: rgba(162, 119, 255, 0.1);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.hamburger span {
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    transition: all var(--transition);
    display: block;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* === HERO === */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 0 24px;
}

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

.hero-greeting {
    font-size: 1.1rem;
    color: var(--cyan);
    font-family: var(--font-mono);
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeInUp 0.8s 0.2s forwards;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    opacity: 0;
    animation: fadeInUp 0.8s 0.4s forwards;
}

/* A11y: 关闭动画的用户 / 辅助工具 / headless 渲染器直接显示 */
@media (prefers-reduced-motion: reduce) {
    .hero-name { opacity: 1; animation: none; }
}

.hero-name-cn {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0;
    animation: fadeInUp 0.8s 0.5s forwards;
}

.hero-typewriter {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    margin-top: 20px;
    min-height: 2em;
    opacity: 0;
    animation: fadeInUp 0.8s 0.6s forwards;
}

.typewriter-text { color: var(--purple); }

.typewriter-cursor {
    color: var(--cyan);
    animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 16px;
    opacity: 0;
    animation: fadeInUp 0.8s 0.8s forwards;
}

.hero-social {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
    opacity: 0;
    animation: fadeInUp 0.8s 1s forwards;
}

.hero-social a {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.hero-social a:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: rgba(162, 119, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--purple-glow);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeInUp 0.8s 1.2s forwards;
}

.scroll-arrow {
    width: 24px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: 12px;
    position: relative;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    background: var(--purple);
    border-radius: 2px;
    transform: translateX(-50%);
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 0.3; }
}

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

/* === Sections Common === */
.section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    margin: 16px auto 48px;
    border-radius: 2px;
}

/* === Animate on scroll === */
.anim-fade {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

/* === ABOUT === */
.about-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 48px;
    align-items: start;
}

.about-left { text-align: center; }

.avatar-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    position: relative;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--purple);
    border: 2px solid var(--border);
}

.avatar-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--purple);
    border-right-color: var(--cyan);
    animation: spin 8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(162, 119, 255, 0.08);
    font-size: 0.95rem;
}

.info-item:last-child { border-bottom: none; }
.info-item i { color: var(--purple); width: 20px; text-align: center; }

.about-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-quote {
    margin-top: 32px;
    padding: 20px;
    border-left: 3px solid var(--purple);
    background: rgba(162, 119, 255, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--text-primary);
}

.about-quote i {
    color: var(--purple);
    margin: 0 8px;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* === TECH STACK === */
.tech-filters, .project-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}

.tech-filter, .project-filter {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-main);
}

.tech-filter:hover, .project-filter:hover {
    border-color: var(--purple);
    color: var(--purple);
}

.tech-filter.active, .project-filter.active {
    background: var(--purple);
    border-color: var(--purple);
    color: #fff;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.tech-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    transition: all var(--transition);
    cursor: default;
}

.tech-card:hover {
    transform: translateY(-4px);
    border-color: var(--purple);
    box-shadow: 0 8px 32px var(--purple-glow);
    background: var(--bg-card-hover);
}

.tech-card.hidden { display: none; }

.tech-icon {
    font-size: 2rem;
    color: var(--cyan);
    margin-bottom: 8px;
    transition: transform var(--transition);
}

.tech-card:hover .tech-icon { transform: scale(1.2); }

.tech-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.tech-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.tech-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    border-radius: 2px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-bar-fill.animated { width: var(--level); }

/* === PROJECTS === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.project-card {
    perspective: 1000px;
    height: 320px;
    cursor: pointer;
    transition: transform var(--transition);
}

.project-card.hidden { display: none; }

.project-card.featured {
    grid-column: span 2;
}

.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.project-card:hover .project-card-inner {
    transform: rotateY(180deg);
}

.project-front, .project-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.project-front {
    background: var(--bg-card);
}

.project-back {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    transform: rotateY(180deg);
    justify-content: center;
}

.project-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.project-icon {
    font-size: 2.5rem;
    color: var(--purple);
    margin-bottom: 16px;
}

.project-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.project-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.project-tags span {
    padding: 4px 10px;
    background: rgba(162, 119, 255, 0.12);
    color: var(--purple);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

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

.project-links a {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-links a:hover {
    background: var(--purple);
    border-color: var(--purple);
    color: #fff;
}

/* === AURORA UNIVERSE === */
.aurora-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 48px;
}

.aurora-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--purple), var(--cyan), var(--purple));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
    display: flex;
    align-items: flex-start;
}

.timeline-item:nth-child(even) { flex-direction: row-reverse; }

.timeline-item::before {
    content: attr(data-year);
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-28px);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--cyan);
    font-weight: 700;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--purple);
    transform: translateX(-50%);
    z-index: 2;
    transition: all var(--transition);
}

.timeline-dot.active { background: var(--purple); }
.timeline-dot.glow {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 20px var(--cyan-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px var(--cyan-glow); }
    50% { box-shadow: 0 0 40px var(--cyan-glow), 0 0 60px rgba(0,217,255,0.15); }
}

.timeline-content {
    width: calc(50% - 48px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}

.timeline-content:hover {
    border-color: var(--purple);
    box-shadow: 0 8px 32px var(--purple-glow);
}

.timeline-item:nth-child(odd) .timeline-content { margin-right: auto; }
.timeline-item:nth-child(even) .timeline-content { margin-left: auto; }

.timeline-content h3 { color: var(--purple); font-size: 1.1rem; margin-bottom: 8px; }
.timeline-content p { color: var(--text-secondary); font-size: 0.9rem; }

.aurora-constellation {
    margin-top: 48px;
    height: 200px;
    position: relative;
}

#aurora-canvas {
    width: 100%;
    height: 100%;
}

/* === EDUCATION === */
.education-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.edu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    gap: 20px;
}

.edu-icon {
    font-size: 2.5rem;
    color: var(--purple);
    flex-shrink: 0;
}

.edu-info h3 { font-size: 1.3rem; margin-bottom: 4px; }
.edu-degree { color: var(--cyan); font-size: 0.95rem; }
.edu-year { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }

.edu-courses h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.course-tags span {
    padding: 4px 10px;
    background: rgba(0, 217, 255, 0.1);
    color: var(--cyan);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.growth-chart {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.growth-chart h3 { font-size: 1.2rem; margin-bottom: 24px; }

.growth-item {
    margin-bottom: 18px;
}

.growth-item span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.growth-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.growth-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color, var(--purple)), var(--cyan));
    border-radius: 4px;
    width: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.growth-fill.animated { width: var(--level); }

/* === INTERESTS === */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.interest-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    transition: all var(--transition);
}

.interest-card:hover {
    transform: translateY(-4px);
    border-color: var(--purple);
    box-shadow: 0 8px 32px var(--purple-glow);
}

.interest-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.interest-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.interest-card p { font-size: 0.85rem; color: var(--text-secondary); }

/* === GITHUB STATS === */
.github-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.github-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.github-card img { max-width: 100%; height: auto; }

.github-card.full-width { grid-column: span 2; }

.contribution-graph {
    width: 100%;
    border-radius: 8px;
}

/* === CONTACT === */
.contact-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 48px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    transition: width var(--transition);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.form-group input:focus ~ .form-line,
.form-group textarea:focus ~ .form-line { width: 100%; }

.btn-submit {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
    font-family: var(--font-main);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--purple-glow);
}

.contact-links h3 {
    font-size: 1.3rem;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.contact-item i { color: var(--purple); width: 20px; text-align: center; }

.contact-social {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.contact-social a {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.contact-social a:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: rgba(162, 119, 255, 0.1);
    transform: translateY(-3px);
}

/* === FOOTER === */
#footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

#footer p { color: var(--text-secondary); font-size: 0.9rem; }
.footer-year { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

#back-to-top {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--purple);
    font-size: 1rem;
    cursor: pointer;
    margin-top: 16px;
    transition: all var(--transition);
}

#back-to-top:hover {
    background: var(--purple);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--purple-glow);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-left { order: -1; }
    .education-grid { grid-template-columns: 1fr; }
    .project-card.featured { grid-column: span 1; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        z-index: 999;
    }

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

    .nav-links a {
        font-size: 1.2rem;
        padding: 12px 24px;
    }

    .hamburger { display: flex; }

    .projects-grid { grid-template-columns: 1fr; }
    .github-grid { grid-template-columns: 1fr; }
    .github-card.full-width { grid-column: span 1; }
    .contact-grid { grid-template-columns: 1fr; }

    .timeline-line { left: 20px; }
    .timeline-item { flex-direction: column !important; padding-left: 48px; }
    .timeline-item::before { left: 20px; transform: translateX(-50%) translateY(-28px); }
    .timeline-dot { left: 20px; }
    .timeline-content { width: 100% !important; margin: 0 !important; }

    .tech-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .interests-grid { grid-template-columns: 1fr; }

    .section { padding: 60px 0; }
}

@media (max-width: 480px) {
    .hero-social { gap: 10px; }
    .hero-social a { width: 40px; height: 40px; font-size: 1rem; }
    .tech-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .project-card { height: 280px; }
}

/* ============================================================
   BLOG SECTION
   ============================================================ */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.blog-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 28px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    border-color: var(--purple);
    box-shadow: 0 8px 32px var(--purple-glow);
    transform: translateY(-4px);
}

.blog-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(162, 119, 255, 0.12);
    color: var(--tag-color, var(--purple));
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    width: fit-content;
    margin-bottom: 14px;
}

.blog-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-title a {
    color: var(--text-primary);
    transition: color var(--transition);
}

.blog-title a:hover {
    color: var(--cyan);
}

.blog-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 16px;
}

.blog-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.blog-date {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-read-more {
    color: var(--cyan);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.blog-read-more:hover {
    color: var(--purple);
    transform: translateX(4px);
}

.blog-read-more.disabled {
    color: var(--text-muted);
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    font-style: italic;
    letter-spacing: 0.02em;
}

.blog-read-more.disabled:hover {
    transform: none;
    color: var(--text-muted);
}

/* ============================================================
   INLINE SVG ICONS (Simple Icons fallback for FA Free gaps)
   ============================================================ */

.icon-svg {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    fill: currentColor;
    flex-shrink: 0;
}

/* Match sizing when used inside project-icon / social circles */
.project-icon .icon-svg {
    width: 2.5rem;
    height: 2.5rem;
}

.hero-social .icon-svg,
.contact-social .icon-svg {
    width: 1.2rem;
    height: 1.2rem;
}

/* ============================================================
   PROJECT CARD GLOW ON HOVER
   ============================================================ */

.project-front {
    transition: all var(--transition);
}

.project-card:hover .project-front {
    border-color: var(--purple);
    box-shadow: 0 0 20px var(--purple-glow), 0 0 40px rgba(0, 217, 255, 0.1);
}

.project-card.featured:hover .project-front {
    box-shadow: 0 0 30px var(--purple-glow), 0 0 60px rgba(0, 217, 255, 0.15);
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--purple-dim), var(--cyan-dim));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--purple), var(--cyan));
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--purple-dim) var(--bg-primary);
}

/* ============================================================
   NAV ACTIVE UNDERLINE ANIMATION
   ============================================================ */

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    border-radius: 1px;
    transition: all var(--transition);
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 60%;
}

/* ============================================================
   BLOG RESPONSIVE
   ============================================================ */

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

/* ============================================================
   AURORA 2026 — IMMERSIVE INTERFACE
   ============================================================ */
:root {
    --bg-primary: #050510;
    --bg-card: rgba(14, 14, 38, 0.72);
    --border: rgba(176, 144, 255, 0.18);
    --glass: rgba(5, 5, 18, 0.72);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    background:
        radial-gradient(circle at 20% -10%, rgba(125, 75, 255, 0.14), transparent 35rem),
        radial-gradient(circle at 95% 35%, rgba(0, 217, 255, 0.08), transparent 32rem),
        var(--bg-primary);
}

body.command-open { overflow: hidden; }

.section { position: relative; }

.scroll-progress {
    position: fixed;
    inset: 0 0 auto;
    height: 2px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.03);
}

#scroll-progress-bar {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient(90deg, var(--purple), #d8b4fe 50%, var(--cyan));
    box-shadow: 0 0 18px var(--cyan-glow);
}

.aurora-veil {
    position: fixed;
    width: 70vw;
    height: 70vw;
    border-radius: 42% 58% 62% 38%;
    filter: blur(90px);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    animation: auroraDrift 18s ease-in-out infinite alternate;
}

.aurora-veil-one {
    top: -38vw;
    left: -8vw;
    background: conic-gradient(from 120deg, transparent, var(--purple), transparent 42%, var(--cyan), transparent);
}

.aurora-veil-two {
    right: -32vw;
    top: 34vh;
    background: conic-gradient(from -40deg, transparent, var(--cyan), transparent 46%, var(--purple), transparent);
    animation-duration: 24s;
    animation-direction: alternate-reverse;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    opacity: 0.025;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

@keyframes auroraDrift {
    to { transform: translate3d(8vw, 12vh, 0) rotate(18deg) scale(1.12); }
}

#navbar.scrolled {
    background: rgba(5, 5, 18, 0.72);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.command-trigger { font-size: 0.75rem; }

#hero { min-height: 100svh; overflow: hidden; }
.hero-content { max-width: 1040px; width: 100%; }

.availability-pill {
    width: fit-content;
    margin: 0 auto 22px;
    padding: 8px 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(0, 217, 255, 0.22);
    border-radius: 999px;
    color: var(--text-secondary);
    background: rgba(0, 217, 255, 0.055);
    backdrop-filter: blur(14px);
    font: 500 0.76rem var(--font-mono);
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeInUp 0.8s 0.05s forwards;
}

.availability-pill:hover { color: #fff; border-color: rgba(0, 217, 255, 0.55); }
.availability-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #49f6a6;
    box-shadow: 0 0 0 5px rgba(73, 246, 166, 0.09), 0 0 14px rgba(73, 246, 166, 0.8);
    animation: livePulse 2s ease-out infinite;
}
@keyframes livePulse { 50% { box-shadow: 0 0 0 9px transparent, 0 0 20px rgba(73, 246, 166, 0.8); } }

.hero-name {
    background-image: linear-gradient(110deg, #fff 0%, #c4b5fd 28%, var(--purple) 48%, var(--cyan) 72%, #fff 100%);
    background-size: 220% auto;
    filter: drop-shadow(0 0 36px rgba(162, 119, 255, 0.16));
    animation: fadeInUp 0.8s 0.4s forwards, nameShimmer 8s 1.2s linear infinite;
}
@keyframes nameShimmer { to { background-position: -220% center; } }

.hero-description {
    max-width: 660px;
    margin: 16px auto 0;
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 1.6vw, 1.05rem);
    opacity: 0;
    animation: fadeInUp 0.8s 0.9s forwards;
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
    opacity: 0;
    animation: fadeInUp 0.8s 1s forwards;
}

.hero-cta {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--border);
    font: 600 0.86rem var(--font-main);
    cursor: pointer;
    transition: border-color .3s, box-shadow .3s, background .3s;
}

.hero-cta.primary {
    color: #070711;
    background: linear-gradient(120deg, #c4b5fd, var(--cyan));
    border-color: transparent;
    box-shadow: 0 12px 38px rgba(0, 217, 255, 0.14);
}
.hero-cta.secondary { color: var(--text-primary); background: rgba(255,255,255,0.035); }
.hero-cta:hover { color: inherit; border-color: rgba(162,119,255,.65); box-shadow: 0 12px 38px var(--purple-glow); }
.hero-cta kbd { opacity: .6; }

.hero-social { margin-top: 22px; animation-delay: 1.1s; }
.hero-social a { backdrop-filter: blur(14px); background: rgba(255,255,255,.025); }

.hero-metrics {
    max-width: 720px;
    margin: 26px auto 0;
    padding-top: 22px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    opacity: 0;
    animation: fadeInUp 0.8s 1.2s forwards;
}
.metric { position: relative; display: grid; gap: 2px; }
.metric:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15%;
    right: 0;
    width: 1px;
    height: 70%;
    background: linear-gradient(transparent, var(--border), transparent);
}
.metric strong {
    font: 700 clamp(1rem, 2vw, 1.35rem) var(--font-mono);
    color: #fff;
}
.metric span { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; }

.tech-card, .timeline-content, .edu-card, .interest-card, .blog-card, .github-card, .info-card {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.project-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform .4s var(--ease-out-expo);
}
.project-front, .project-back {
    overflow: hidden;
    background: linear-gradient(145deg, rgba(22, 22, 56, .86), rgba(10, 10, 29, .92));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.project-front::before, .project-back::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--card-x, 50%) var(--card-y, 50%), rgba(162,119,255,.16), transparent 40%);
    opacity: 0;
    transition: opacity .3s;
}
.project-card:hover .project-front::before,
.project-card:hover .project-back::before { opacity: 1; }
.project-card.flipped .project-card-inner { transform: rotateY(180deg); }
.project-card.spotlight {
    animation: cardSpotlight 1.8s var(--ease-out-expo);
}
@keyframes cardSpotlight {
    0%, 100% { filter: none; }
    30% { filter: drop-shadow(0 0 22px rgba(0,217,255,.65)); }
}

.mesh-status {
    max-width: 980px;
    margin: 0 auto 64px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(20,20,52,.7), rgba(5,5,18,.82));
    box-shadow: 0 24px 80px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.04);
    overflow: hidden;
}
.mesh-status-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font: 600 .7rem var(--font-mono);
    letter-spacing: .1em;
}
.live-signal { color: #49f6a6; }
.live-signal i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}
.mesh-nodes { display: grid; grid-template-columns: repeat(5, 1fr); }
.mesh-node {
    min-height: 126px;
    padding: 20px 12px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    position: relative;
}
.mesh-node:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 43px;
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    box-shadow: 0 0 8px var(--purple);
}
.mesh-node > i { font-size: 1.45rem; color: var(--purple); margin-bottom: 5px; filter: drop-shadow(0 0 10px var(--purple-glow)); }
.mesh-node strong { font-size: .9rem; }
.mesh-node span { color: var(--text-muted); font: .62rem var(--font-mono); text-align: center; }
.mesh-node.planned { opacity: .55; }

.aurora-constellation {
    height: 300px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: radial-gradient(circle at 50% 50%, rgba(162,119,255,.08), transparent 60%);
}
#aurora-canvas { cursor: crosshair; }
.constellation-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    color: var(--text-muted);
    font: .68rem var(--font-mono);
    white-space: nowrap;
    pointer-events: none;
}

.command-palette {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: start center;
    padding: min(18vh, 160px) 20px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
}
.command-palette.open { opacity: 1; visibility: visible; }
.command-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(1, 1, 8, .74);
    backdrop-filter: blur(18px);
    cursor: default;
}
.command-dialog {
    width: min(620px, 100%);
    max-height: min(620px, 72vh);
    position: relative;
    border: 1px solid rgba(162,119,255,.34);
    border-radius: 18px;
    background: rgba(9,9,27,.96);
    box-shadow: 0 32px 120px rgba(0,0,0,.65), 0 0 70px rgba(162,119,255,.12);
    overflow: hidden;
    transform: translateY(-18px) scale(.98);
    transition: transform .35s var(--ease-out-expo);
}
.command-palette.open .command-dialog { transform: none; }
.command-search { display: flex; align-items: center; gap: 12px; padding: 17px 18px; border-bottom: 1px solid var(--border); color: var(--purple); }
.command-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: 500 1rem var(--font-main);
}
.command-search input::placeholder { color: var(--text-muted); }
kbd {
    padding: 2px 6px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 5px;
    color: var(--text-muted);
    background: rgba(255,255,255,.04);
    font: .68rem var(--font-mono);
}
.command-results { max-height: 390px; padding: 8px; overflow-y: auto; }
.command-item {
    width: 100%;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 10px;
    color: var(--text-secondary);
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.command-item:hover, .command-item.active { color: #fff; background: rgba(162,119,255,.12); }
.command-item i { width: 22px; color: var(--purple); text-align: center; }
.command-item-copy { flex: 1; display: grid; gap: 1px; }
.command-item-copy strong { font-size: .86rem; }
.command-item-copy small { color: var(--text-muted); font-size: .68rem; }
.command-item > small { color: var(--text-muted); font: .64rem var(--font-mono); }
.command-empty { padding: 28px; color: var(--text-muted); text-align: center; }
.command-footer { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .67rem; }
.command-footer span:last-child { margin-left: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 768px) {
    .command-trigger { display: none; }
    .hero-content { padding-top: 76px; }
    .hero-greeting, .hero-name, .hero-name-cn, .hero-typewriter, .hero-subtitle,
    .hero-description, .hero-actions, .hero-social, .hero-metrics, .availability-pill {
        opacity: 1;
        animation: none;
    }
    .availability-pill { font-size: .65rem; }
    .hero-description { max-width: 520px; }
    .hero-metrics { grid-template-columns: repeat(2, 1fr); gap: 20px 0; }
    .metric:nth-child(2)::after { display: none; }
    .metric span { font-size: .62rem; }
    .mesh-nodes { grid-template-columns: repeat(2, 1fr); }
    .mesh-node:not(:last-child)::after { display: none; }
    .mesh-node:last-child { grid-column: span 2; }
    .mesh-status-head { align-items: flex-start; flex-direction: column; }
    .aurora-constellation { height: 260px; padding: 8px; }
    .command-palette { padding-top: 9vh; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; align-items: stretch; padding: 0 18px; }
    .hero-cta { width: 100%; }
    .hero-social { gap: 8px; }
    .hero-metrics { margin-top: 20px; }
    .constellation-hint { width: 90%; white-space: normal; text-align: center; }
    .command-footer span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .hero-greeting, .hero-name, .hero-name-cn, .hero-typewriter, .hero-subtitle,
    .hero-description, .hero-actions, .hero-social, .hero-metrics, .availability-pill,
    .scroll-indicator, .anim-fade {
        opacity: 1;
        transform: none;
    }
    .aurora-veil, #particles-canvas { display: none; }
    .project-card:hover .project-card-inner { transform: none; }
}
