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

:root {
    --bg: #fbfbfd;
    --surface: #f5f5f7;
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(15, 23, 42, 0.08);
    --glass-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --glass-inner: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    --text-primary: #111111;
    --text-secondary: #1f2937;
    --text-tertiary: #4b5563;
    --accent: #0071e3;
    --border: rgba(15, 23, 42, 0.08);
    --max-width: 1100px;
    --section-gap: 100px;
    --radius: 16px;
    --radius-sm: 10px;
}

[data-theme="dark"] {
    --bg: #000000;
    --surface: #111111;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    --glass-inner: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-tertiary: #888888;
    --border: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

::selection {
    background: rgba(0, 113, 227, 0.15);
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---- Fixed Background ---- */
.bg-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bg-fixed img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transform: scale(1.05);
    transition: filter 0.3s ease;
}

[data-theme="dark"] .bg-fixed img {
    filter: invert(1) hue-rotate(180deg);
}

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    transition: color 0.2s;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--text-primary);
    border-radius: 1px;
}

/* Theme Toggle & Controls */
.mobile-controls {
    display: none;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.theme-toggle .icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle .icon-moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
    display: flex;
}

.theme-toggle:hover {
    background: rgba(128, 128, 128, 0.1);
}

/* Hamburger */
.menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-btn span {
    width: 20px;
    height: 1.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.menu-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 5px);
}

.menu-btn.open span:nth-child(2) {
    opacity: 0;
}

.menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 99;
    flex-direction: column;
    padding: 16px 40px;
    gap: 4px;
}

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

.mobile-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s;
}

.mobile-link:last-child {
    border-bottom: none;
}

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

/* ---- Hero ---- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 40px 80px;
}

.hero-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.hero-avatar span {
    font-size: 36px;
    font-weight: 200;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.hero-name {
    font-size: 64px;
    font-weight: 200;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.hero-title {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.hero-sub {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

/* ---- Sections ---- */
.section {
    width: 100%;
    padding: var(--section-gap) 0;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.section-title {
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: -0.01em;
}

#about {
    border-top: 1px solid var(--border);
}

/* ---- About ---- */
.about-text {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.about-text p {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0;
    max-width: 760px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* ---- Skills ---- */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 720px;
    margin: 0 auto;
}

.skill-group {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.skill-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    padding-top: 8px;
}

.skill-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.pill {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background 0.2s;
}

.pill:hover {
    background: rgba(255, 255, 255, 0.85);
}

/* ---- Projects ---- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), var(--glass-inner);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
}

.project-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 12px;
}

.project-name {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.project-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex: 1;
}

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

.project-tags span {
    background: var(--surface);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ---- Contact ---- */
.contact-sub {
    text-align: center;
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: -32px;
    margin-bottom: 48px;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.85);
}

.contact-icon {
    font-size: 24px;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-weight: 600;
}

.contact-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.contact-value {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--border);
    padding: 60px 0;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .desktop-theme {
        display: none;
    }

    .mobile-controls {
        display: flex;
    }

    .menu-btn {
        display: flex;
    }

    .nav-inner {
        padding: 0 20px;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-name {
        font-size: 40px;
    }

    .hero-title {
        font-size: 20px;
    }

    .hero-avatar {
        width: 96px;
        height: 96px;
    }

    .hero-avatar span {
        font-size: 28px;
    }

    .section-inner {
        padding: 0 20px;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        margin-bottom: 32px;
    }

    .skill-group {
        flex-direction: column;
        gap: 10px;
    }

    .skill-label {
        width: auto;
        padding-top: 0;
    }

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

    .contact-cards {
        grid-template-columns: 1fr 1fr;
    }

    .footer-inner {
        padding: 0 20px;
    }

    .mobile-menu {
        padding: 16px 20px;
    }

    .about-text p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 32px;
    }

    .contact-cards {
        grid-template-columns: 1fr;
    }
}
