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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0066cc;
    --accent-hover: #004499;
    --border: #d2d2d7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --font-stack: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
                  'SF Pro', 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    --font-stack-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                         'SF Pro', 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

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

body {
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-variant-ligatures: common-ligatures;
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.47059;
    font-weight: 400;
    font-size: 17px;
    letter-spacing: -0.022em;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.nav-logo {
    font-size: 21px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    transition: var(--transition);
    letter-spacing: -0.01em;
}

.nav-menu a:hover {
    opacity: 1;
    color: var(--accent);
}

/* Language Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-primary);
    opacity: 0.8;
    transition: var(--transition);
    padding: 4px 8px;
    border-radius: 4px;
}

.nav-lang-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.nav-lang-btn .current-lang {
    display: block;
}

.nav-lang-btn .dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-dropdown.active .nav-lang-btn .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 120px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.nav-dropdown.active .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: var(--transition);
    letter-spacing: -0.01em;
}

.nav-dropdown-menu a:hover {
    background: var(--bg-secondary);
    color: var(--accent);
}

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

/* Section Styles */
.section {
    padding: 140px 0;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 72px;
}

.section-label {
    font-size: 56px;
    display: block;
    margin-bottom: 20px;
    line-height: 1.07143;
}

.section-title {
    font-family: var(--font-stack-display);
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.07143;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 0 80px;
    background:
        url('images/background.jpg'),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: scroll, scroll;
    background-color: #1a1a2e;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(29, 29, 31, 0.4) 100%);
    pointer-events: none;
}

.hero-container {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
}

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

.hero-title {
    font-family: 'MingMeiXiangChunTian', 'Brush Script MT', 'Cursive', 'Segoe Script', 'Snell Roundhand', 'Bradley Hand', 'Chalkboard SE', 'Comic Sans MS', cursive;
    font-size: clamp(32px, 10vw, 96px);
    font-weight: normal;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin-bottom: 24px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: inline-block;
    position: relative;
    padding: 10px;
}

.hero-title-text {
    display: inline-block;
    position: relative;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-title-text.visible {
    opacity: 1;
}

.hero-subtitle {
    font-size: clamp(19px, 3vw, 28px);
    font-weight: 400;
    opacity: 0;
    margin-bottom: 40px;
    letter-spacing: -0.022em;
    line-height: 1.2;
    transition: opacity 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
}

.hero-description {
    font-size: 21px;
    font-weight: 400;
    opacity: 0;
    margin-bottom: 48px;
    font-style: italic;
    letter-spacing: -0.022em;
    line-height: 1.2;
    transition: opacity 0.8s ease;
}

.hero-description.visible {
    opacity: 1;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-actions.visible {
    opacity: 1;
}

.hero-contact {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-contact.visible {
    opacity: 1;
}

.hero-subtitle,
.hero-description,
.hero-actions,
.hero-contact {
    transform: translateY(20px);
}

.hero-subtitle.visible,
.hero-description.visible,
.hero-actions.visible,
.hero-contact.visible {
    transform: translateY(0);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    letter-spacing: -0.022em;
}

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

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.hero-contact {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.contact-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    opacity: 0;
    transition: var(--transition);
    animation: fadeInUp 0.8s ease 1.5s forwards;
}

.contact-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
}

.scroll-indicator {
    opacity: 0.7;
    font-size: 12px;
}

.scroll-indicator span {
    display: block;
    margin-bottom: 8px;
}

.scroll-arrow {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 21px;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    color: var(--text-primary);
}

/* Education Section */
.education-card {
    background: white;
    border-radius: 18px;
    padding: 44px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto 24px;
}

.education-logo {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.education-info h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.003em;
}

.education-major {
    font-size: 17px;
    color: var(--accent);
    margin-bottom: 6px;
    font-weight: 400;
    letter-spacing: -0.022em;
}

.education-time {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: -0.022em;
}

.education-tagline {
    text-align: center;
    margin-top: 36px;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-light);
}

.education-tagline p {
    font-size: 18px;
    line-height: 1.5;
    color: var(--text-primary);
    font-style: italic;
    letter-spacing: -0.022em;
    margin: 0;
}

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

.project-card {
    background: white;
    border-radius: 18px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.project-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-right: 60px;
}

.project-organization {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.project-mentor {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

.project-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

.project-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.project-link:hover {
    text-decoration: underline;
}

/* Skills Section */
.tech-stack-container {
    max-width: 800px;
    margin: 0 auto;
}

.tech-stack-subtitle {
    text-align: center;
    font-size: 21px;
    font-weight: 500;
    margin-bottom: 40px;
    color: var(--accent);
    letter-spacing: -0.022em;
}

.tech-stack-section {
    background: white;
    border-radius: 18px;
    padding: 44px;
    box-shadow: var(--shadow-md);
}

.tech-stack-section h3 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

.tech-stack-item {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 24px;
    gap: 8px;
}

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

.tech-stack-label {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 100px;
    letter-spacing: -0.022em;
}

.tech-stack-value {
    color: var(--text-secondary);
    flex: 1;
    letter-spacing: -0.022em;
}

.tech-stack-philosophy {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.tech-stack-philosophy .tech-stack-value {
    font-style: italic;
    color: var(--accent);
    font-weight: 500;
}

/* Tech Notes Section */
.notes-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.notes-content p {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.notes-placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

/* Gallery Section */
.gallery-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 48px;
}

.gallery-intro p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.gallery-intro p:last-child {
    color: var(--text-secondary);
    font-size: 15px;
}

.gallery-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 40px 0;
}

.gallery-scroll {
    flex: 1;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 20px 0;
}

.gallery-scroll::-webkit-scrollbar {
    display: none;
}

.gallery-items {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 0 20px;
}

.gallery-section {
    width: 100%;
}

.gallery-section-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    padding-left: 4px;
}

.gallery-items-horizontal,
.gallery-items-vertical {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 0;
}

.gallery-items-horizontal::-webkit-scrollbar,
.gallery-items-vertical::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--surface-primary);
    cursor: pointer;
}

.gallery-item-horizontal {
    width: 400px;
    height: 300px;
}

.gallery-item-vertical {
    width: 250px;
    height: 350px;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}

.gallery-item img.loaded {
    opacity: 1;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--surface-primary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.gallery-nav:hover {
    background: var(--surface-hover);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-nav-left {
    left: -30px;
}

.gallery-nav-right {
    right: -30px;
}

.gallery-nav span {
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    user-select: none;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.gallery-placeholder {
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.gallery-placeholder:hover {
    transform: scale(1.02);
}

.gallery-note {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 14px;
}

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

.interest-item {
    background: white;
    border-radius: 18px;
    padding: 36px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.interest-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.interest-icon {
    font-size: 52px;
    margin-bottom: 20px;
    display: block;
}

.interest-item h3 {
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.022em;
}

.interest-item p {
    font-size: 17px;
    line-height: 1.47059;
    color: var(--text-secondary);
    letter-spacing: -0.022em;
}

.interests-summary {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.interests-summary p {
    font-size: 19px;
    line-height: 1.47059;
    color: var(--text-primary);
    font-style: italic;
    letter-spacing: -0.022em;
}

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

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    background: white;
    border-radius: 14px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.contact-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.contact-item strong {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: -0.022em;
}

.contact-item a,
.contact-item span {
    font-size: 17px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: -0.022em;
}

.contact-item a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.contact-actions {
    text-align: center;
    margin-top: 32px;
}

.contact-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-note {
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 15px;
    font-style: italic;
    letter-spacing: -0.022em;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 48px 0;
    text-align: center;
}

.footer-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: -0.022em;
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide all nav links except the language dropdown */
    .nav-menu > li:not(.nav-dropdown) {
        display: none;
    }

    .nav-dropdown {
        position: relative;
    }

    .nav-dropdown-menu {
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 8px;
        background: white;
        border-radius: 12px;
        box-shadow: var(--shadow-lg);
        min-width: 120px;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: var(--transition);
    }

    .nav-dropdown.active .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-container {
        justify-content: space-between;
        padding: 8px 16px;
        height: 52px;
    }

    .nav-logo {
        font-size: 20px;
    }

    .nav-lang-btn {
        background: rgba(0, 0, 0, 0.05);
        padding: 6px 12px;
        border-radius: 20px;
    }

    .nav-lang-btn:hover {
        background: rgba(0, 0, 0, 0.1);
    }

    .section-title {
        font-size: 36px;
    }

    .section-label {
        font-size: 36px;
    }

    .section {
        padding: 80px 0;
    }

    .hero {
        background:
            url('images/background.jpg'),
            linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
        background-size: cover, cover;
        background-position: center top, center top;
        background-repeat: no-repeat, no-repeat;
        background-attachment: scroll, scroll;
        min-height: 100vh;
    }

    .hero-title {
        font-family: 'MingMeiXiangChunTian', 'Brush Script MT', 'Cursive', 'Segoe Script', 'Snell Roundhand', 'Bradley Hand', 'Chalkboard SE', 'Comic Sans MS', cursive;
        font-size: 36px;
        font-weight: normal;
    }

    .hero-title-text {
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    .hero-tags {
        flex-direction: column;
        align-items: center;
    }

    .education-card {
        flex-direction: column;
        text-align: center;
    }

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

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

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .gallery-nav-left {
        left: -15px;
    }

    .gallery-nav-right {
        right: -15px;
    }

    .gallery-item-horizontal {
        width: 280px;
        height: 200px;
    }

    .gallery-item-vertical {
        width: 200px;
        height: 280px;
    }

    .gallery-section-label {
        font-size: 12px;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }

    .contact-item .contact-icon {
        margin: 0 auto;
    }
}

/* Tablet responsive */
@media (max-width: 1024px) {
    .container {
        max-width: 720px;
    }

    .gallery-item-horizontal {
        width: 320px;
        height: 240px;
    }

    .gallery-item-vertical {
        width: 220px;
        height: 310px;
    }

    .hero-title {
        font-size: clamp(40px, 7vw, 56px);
    }
}

/* Mobile responsive - contact items */
@media (max-width: 768px) {
    html {
        font-size: 14px; /* Smaller base font for mobile */
    }

    .container {
        max-width: 100%;
        padding: 0 16px;
    }

    .nav-container {
        padding: 0 16px;
    }
    .contact-item {
        flex-direction: column;
        text-align: center;
    }

    .contact-item .contact-icon {
        margin: 0 auto;
    }
}

/* Tablet responsive */
@media (max-width: 1024px) {
    .gallery-item-horizontal {
        width: 320px;
        height: 240px;
    }

    .gallery-item-vertical {
        width: 220px;
        height: 310px;
    }
}

@media (max-width: 480px) {
    .container,
    .hero-container,
    .nav-container {
        padding: 0 16px;
    }

    .hero-title {
        font-family: 'MingMeiXiangChunTian', 'Brush Script MT', 'Cursive', 'Segoe Script', 'Snell Roundhand', 'Bradley Hand', 'Chalkboard SE', 'Comic Sans MS', cursive;
        font-size: 32px;
    }

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

    .hero-description {
        font-size: 16px;
    }

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

    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .section-title {
        font-size: 28px;
    }

    /* Touch-friendly tap targets */
    .nav-lang-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .gallery-nav {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-title {
        font-size: clamp(48px, 6vw, 72px);
    }

    .hero-subtitle {
        font-size: clamp(16px, 2vw, 22px);
    }

    .hero-description {
        font-size: clamp(18px, 2.5vw, 21px);
    }
}

/* Desktop specific adjustments */
@media (min-width: 1025px) {
    .hero-title {
        font-size: clamp(56px, 8vw, 96px);
    }

    .hero-subtitle {
        font-size: clamp(22px, 2.5vw, 28px);
    }

    .hero-description {
        font-size: clamp(19px, 2vw, 21px);
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Reduce shadow complexity */
    .nav {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .project-card,
    .education-card,
    .contact-item {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    /* Optimize animations */
    .hero-subtitle,
    .hero-description,
    .hero-actions,
    .hero-contact {
        will-change: opacity, transform;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper text for retina displays */
    .hero-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .hero-subtitle,
    .hero-description,
    .hero-actions,
    .hero-contact {
        transition: none;
        transform: none;
        opacity: 1 !important;
    }

    .hero-title-text {
        transition: none;
        opacity: 1 !important;
    }
}
