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

:root {
    --bg: #ffffff;
    --bg-alt: #f7f8fa;
    --surface: #ffffff;
    --border: #e2e4e9;
    --text: #1a1a2e;
    --text-muted: #555770;
    --accent: #4f46e5;
    --accent-dark: #4338ca;
    --accent-glow: rgba(79, 70, 229, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    transition: border-color 0.3s;
    border-bottom: 1px solid transparent;
}

nav.scrolled {
    border-bottom-color: var(--border);
}

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

.nav-logo {
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-muted);
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Sections */
header {
    padding: 128px 0 72px;
}

section {
    padding: 72px 0;
    border-top: 1px solid var(--border);
}

section:nth-of-type(even) {
    background: var(--bg-alt);
}

h1 {
    font-size: clamp(2.6rem, 7vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 24px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 28px;
}

header h2 {
    margin-top: 56px;
    margin-bottom: 16px;
}

/* Social links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.social:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow);
}

.social img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* About */
.about-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}

.about-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.75;
    max-width: 580px;
}

.about-text p + p {
    margin-top: 14px;
}

.about-text a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.about-text a:hover {
    text-decoration: underline;
}

.about-photo {
    flex: 0 0 150px;
}

.about-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.12);
}

/* Logo tiles */
.logo {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
}

.logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Experience / Awards / Education entries */
.entries {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.entry {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: border-color 0.2s;
}

.entry:hover {
    border-color: var(--accent);
}

.entry-compact {
    align-items: center;
    padding: 18px 24px;
}

.entry-body {
    flex: 1;
    min-width: 0;
}

.entry-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.entry h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.entry h3 a {
    text-decoration: none;
}

.entry h3 a:hover {
    color: var(--accent);
}

.entry h3 a::after {
    content: " \2197";
    font-size: 0.8em;
    color: var(--text-muted);
}

.year {
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--accent-dark);
}

.role {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    margin-top: 2px;
}

.entry ul {
    list-style: none;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entry li {
    position: relative;
    padding-left: 16px;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.entry li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* Education */
.degrees {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
}

.degree {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.degree:first-child {
    border-top: none;
    padding-top: 4px;
}

.degree-name {
    font-size: 0.98rem;
    font-weight: 500;
}

.degree-note {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.project {
    display: block;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.project:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.project-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.project-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
}

.project h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.project h3::after {
    content: " \2197";
    font-size: 0.8em;
    color: var(--text-muted);
}

.project p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-dark);
    background: var(--accent-glow);
    padding: 3px 10px;
    border-radius: 999px;
}

/* Footer */
footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(12px);
        padding: 20px 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active {
        display: flex;
    }

    header {
        padding: 100px 0 56px;
    }

    header h2 {
        margin-top: 40px;
    }

    section {
        padding: 56px 0;
    }

    .about-row {
        gap: 16px;
    }

    .about-photo {
        flex-basis: 110px;
    }

    .about-photo img {
        border-radius: 10px;
    }

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

    .entry {
        gap: 14px;
        padding: 18px;
    }

    .logo {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }
}
