:root {
    --text-primary: #111;
    --text-secondary: #555;
    --text-tertiary: #888;
    --bg-primary: #fff;
    --bg-secondary: #f7f7f7;
    --bg-hover: #f0f0f0;
    --border-color: #eee;
    --accent: #333;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Header */
header {
    padding: 100px 0 60px;
}

h1 {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 4px;
}

.location {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Navigation */
nav {
    padding: 20px 0;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* Sections */
section {
    padding: 56px 0;
}

h2 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
    margin-bottom: 32px;
}

/* About */
#about p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.8;
}

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

/* Experience */
.experience-item {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}

.experience-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.experience-header h3 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.role {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

.duration {
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
    font-weight: 500;
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 4px;
}

.experience-item ul {
    list-style: none;
    padding-left: 0;
}

.experience-item li {
    position: relative;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.7;
}

.experience-item li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    background: var(--border-color);
    border-radius: 50%;
}

.experience-item li:last-child {
    margin-bottom: 0;
}

/* Education */
.education-item {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.education-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 16px;
}

.education-header h3 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.degree {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.thesis {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 8px;
    line-height: 1.6;
}

.course-list {
    list-style: none;
    margin-top: 12px;
}

.course-list li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
    line-height: 1.6;
}

.course-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    background: var(--border-color);
    border-radius: 50%;
}

/* Projects */
.project-item {
    margin-bottom: 24px;
}

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

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 16px;
}

.project-header h3 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.project-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
    transition: all var(--transition);
    white-space: nowrap;
}

.project-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

/* Skills */
.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.skill-group h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.tag {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.tag:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Beyond Work */
.beyond-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.beyond-link {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition);
}

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

/* Contact */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contact-item {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 18px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all var(--transition);
}

.contact-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Footer */
footer {
    padding: 48px 0 64px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

footer p {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Animations */
section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    header {
        padding: 72px 0 48px;
    }

    h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 16px;
    }

    nav {
        gap: 6px;
        padding: 16px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
    }

    section {
        padding: 40px 0;
    }

    h2 {
        margin-bottom: 24px;
    }

    .experience-item {
        margin-bottom: 32px;
        padding-bottom: 32px;
    }

    .skills-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    header {
        padding: 56px 0 40px;
    }

    h1 {
        font-size: 26px;
    }

    .subtitle {
        font-size: 15px;
    }

    .location {
        font-size: 13px;
    }

    nav {
        margin: 0 -20px;
        padding: 14px 20px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    section {
        padding: 36px 0;
    }

    h2 {
        font-size: 10px;
        margin-bottom: 20px;
    }

    #about p {
        font-size: 14px;
    }

    .experience-header {
        flex-direction: column;
        gap: 8px;
    }

    .experience-header h3 {
        font-size: 16px;
    }

    .duration {
        align-self: flex-start;
    }

    .experience-item li {
        font-size: 13px;
        padding-left: 16px;
    }

    .experience-item li::before {
        top: 8px;
        width: 4px;
        height: 4px;
    }

    .education-header {
        flex-direction: column;
        gap: 4px;
    }

    .education-header h3 {
        font-size: 16px;
    }

    .degree {
        font-size: 13px;
    }

    .thesis {
        font-size: 12px;
    }

    .skills-container {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .skill-group h3 {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .tag {
        font-size: 12px;
        padding: 5px 10px;
    }

    .contact-links {
        flex-direction: column;
        gap: 10px;
    }

    .contact-item {
        text-align: center;
        padding: 12px 18px;
    }

    footer {
        padding: 40px 0 56px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .container {
        padding: 0 16px;
    }

    h1 {
        font-size: 24px;
    }

    nav {
        margin: 0 -16px;
        padding: 12px 16px;
    }

    .nav-link {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    section {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .nav-link,
    .tag,
    .contact-item {
        transition: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f0f0f0;
        --text-secondary: #a0a0a0;
        --text-tertiary: #707070;
        --bg-primary: #0d0d0d;
        --bg-secondary: #1a1a1a;
        --bg-hover: #252525;
        --border-color: #252525;
    }

    nav {
        background: rgba(13, 13, 13, 0.9);
    }
}
