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

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Global Navigation */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s ease;
}

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

.global-nav__inner {
    width: min(100% - 3rem, 1180px);
    min-height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.global-nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
}

.global-nav__brand:hover {
    text-decoration: none;
}

.global-nav__mark {
    position: relative;
    width: 28px;
    height: 28px;
    border: 1px solid var(--text-primary);
    border-radius: 50%;
    flex: 0 0 auto;
}

.global-nav__mark::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid var(--text-light);
    border-radius: 50%;
}

.global-nav__mark::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 4px;
    height: 4px;
    background: var(--text-primary);
    border-radius: 50%;
}

.global-nav__brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.global-nav__brand-text span {
    font-family: var(--font-en);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.global-nav__links {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    margin: 0;
    padding: 0;
}

.global-nav__links li {
    margin: 0;
}

.global-nav__links li + li {
    border-left: 1px solid var(--border-color);
}

.global-nav__links a {
    display: block;
    padding: 0.2rem 0.95rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.global-nav__links a:hover {
    color: var(--text-primary);
    background: var(--bg-alt);
}

/* Resume Section Navigation */
.site-nav {
    position: fixed;
    top: 50%;
    right: var(--spacing-lg);
    transform: translateY(-50%);
    z-index: 90;
}

.site-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-end;
}

.site-nav a {
    text-decoration: none;
    font-family: var(--font-en);
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

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

.mobile-nav {
    display: none;
}

/* Sections */
section {
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--border-color);
}

section:last-child {
    border-bottom: none;
}

/* Hero Section */
.hero {
    padding-top: var(--spacing-xxl);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: var(--spacing-md);
}

.hero-meta {
    font-family: var(--font-en);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-lg);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.hero-meta span::after {
    content: '/';
    margin-left: var(--spacing-sm);
    color: var(--border-color);
}

.hero-meta span:last-child::after {
    display: none;
}

/* Timeline & Experiences */
.experience-item {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.experience-header {
    margin-bottom: var(--spacing-sm);
}

.experience-meta {
    font-family: var(--font-en);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    display: block;
}

.experience-title {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
}

/* Products & AI Cards */
.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.project-item {
    border-left: 2px solid var(--border-color);
    padding-left: var(--spacing-md);
    transition: border-color 0.3s ease;
}

.project-item:hover {
    border-left-color: var(--text-light);
}

.project-item h3 {
    margin-bottom: var(--spacing-xs);
}

/* Images */
figure {
    margin: var(--spacing-md) 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    text-align: center;
}

/* Responsive Video */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    margin: var(--spacing-md) 0;
    border-radius: 4px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Certificates */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.cert-item img {
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(80%);
}

.cert-item img:hover {
    filter: grayscale(0%);
}

.tag {
    display: inline-block;
    font-size: 0.8rem;
    font-family: var(--font-en);
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.article-list li {
    margin-bottom: var(--spacing-sm);
}

.article-list a {
    text-decoration: none;
    font-weight: 500;
}

.article-list a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1100px) {
    .site-nav {
        display: none;
    }

    .mobile-nav {
        display: flex;
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid var(--border-color);
        padding: var(--spacing-xs);
        z-index: 89;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav ul {
        list-style: none;
        display: flex;
        gap: var(--spacing-md);
        margin: 0 auto;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .mobile-nav li {
        margin: 0;
    }

    .mobile-nav a {
        text-decoration: none;
        font-family: var(--font-en);
        font-size: 0.85rem;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .mobile-nav a.active {
        color: var(--text-primary);
    }

    .global-nav:not(.visible) + .mobile-nav {
        top: 0;
    }

    .global-nav__inner {
        width: 100%;
        min-height: 58px;
        padding-left: var(--spacing-sm);
        gap: var(--spacing-sm);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .global-nav__inner::-webkit-scrollbar {
        display: none;
    }

    .global-nav__brand {
        position: sticky;
        left: 0;
        z-index: 1;
        padding-right: var(--spacing-sm);
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.96) 85%, rgba(255, 255, 255, 0));
    }

    .global-nav__links {
        padding-right: var(--spacing-sm);
    }

    .global-nav__links a {
        padding-inline: 0.75rem;
        font-size: 0.8rem;
    }

    .hero {
        padding-top: var(--spacing-xl);
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
        --spacing-xxl: 5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero-avatar {
        width: 80px;
        height: 80px;
    }

    .global-nav__brand-text {
        font-size: 0.84rem;
    }

    .global-nav__brand-text span {
        font-size: 0.55rem;
    }

    .global-nav__mark {
        width: 24px;
        height: 24px;
    }

    .global-nav__mark::before {
        inset: 7px;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--bg-alt);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.cert-item img {
    cursor: zoom-in;
}
