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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
}

.navbar {
    background: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

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

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.scroll-sidebar {
    width: 250px;
    background: var(--card-bg);
    padding: 1.5rem 1rem;
    overflow: hidden;
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
    border-left: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.scroll-sidebar h3 {
    margin-bottom: 1rem;
}

.scroll-container {
    height: calc(100% - 3rem);
    overflow: hidden;
    position: relative;
}

.scroll-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: scroll-vertical 60s linear infinite;
}

.scroll-content:hover {
    animation-play-state: paused;
}

@keyframes scroll-vertical {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

.scroll-item {
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    padding: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.scroll-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.scroll-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    max-height: 80px;
    object-fit: contain;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.95;
}

.section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.section h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--secondary-color);
}

.section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.section ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.section li {
    margin-bottom: 0.5rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.image-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-card img,
.image-card video {
    width: 100%;
    height: auto;
    display: block;
}

.image-card .caption {
    padding: 1rem;
    background: var(--bg-color);
    font-size: 0.9rem;
    text-align: center;
}

.tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.tech-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s;
}

.tech-item:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.product-card {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.product-card h3 {
    margin-top: 0;
}

.product-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.product-card a:hover {
    text-decoration: underline;
}

.contact-info {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.contact-info p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.personal-info-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.personal-info-card h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

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

.info-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.info-item strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.info-item span {
    font-size: 1.1rem;
    font-weight: 500;
}

.language-skills {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.language-skills h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.language-item {
    margin-bottom: 1.5rem;
}

.language-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    transition: width 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.progress-fill.mandarin {
    width: 100%;
}

.progress-fill.cantonese {
    width: 98%;
}

.progress-fill.english {
    width: 60%;
}

@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .scroll-sidebar {
        width: 100%;
        position: static;
        height: auto;
        max-height: 500px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
}
