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

:root {
    --bg: #0d1117;
    --bg-nav: rgba(13, 17, 23, 0.95);
    --text-primary: #f0f2f5;
    --text-secondary: #b0b8c4;
    --text-muted: #6b7280;
    --accent: #5eead4;
    --border: rgba(255, 255, 255, 0.08);
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
}

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

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

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

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.01em;
    transition: color 0.2s;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 8px 0;
}

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

/* Header */
.header {
    padding: 64px 0 48px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.profile-pic {
    width: 130px;
    height: 130px;
    border-radius: 6px;
    object-fit: cover;
    object-position: center 20%;
    flex-shrink: 0;
}

.header-text h1 {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.header-text h1 .name-jp {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 300;
    margin-left: 12px;
}

.header-text .title {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 300;
    margin-top: 8px;
    line-height: 1.5;
}

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

section + section {
    border-top: 1px solid var(--border);
}

h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 32px;
    scroll-margin-top: 64px;
}

/* Background / CV */
.cv-entry {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.65;
}

.cv-date {
    flex-shrink: 0;
    width: 100px;
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

.cv-desc {
    color: var(--text-primary);
    font-weight: 400;
}

.cv-desc .jp {
    color: var(--text-muted);
    font-size: 13px;
    display: block;
    margin-top: 2px;
}

/* Research areas */
.research-text {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
}

.research-text .jp {
    color: var(--text-muted);
    font-size: 14px;
    display: block;
    margin-top: 4px;
}

/* Publications */
.pub-list {
    list-style: none;
}

.pub-item {
    counter-increment: pub-counter -1;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.pub-item:first-child {
    padding-top: 0;
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-item::before {
    content: "[" counter(pub-counter) "] ";
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.pub-item .author-highlight {
    color: var(--accent);
}

.pub-item .pub-title {
    color: #ffffff;
    font-weight: 500;
}

.pub-item em {
    font-style: italic;
}

.pub-item .pub-note {
    color: var(--text-muted);
    font-size: 13px;
}

.pub-item a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.pub-item a:hover {
    text-decoration: underline;
}

/* Lists */
.entry-list {
    list-style: none;
}

.entry-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
}

.entry-list li:first-child {
    padding-top: 0;
}

.entry-list li:last-child {
    border-bottom: none;
}

.entry-list .year {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
}

.entry-list .jp {
    color: var(--text-muted);
    font-size: 13px;
    display: block;
    margin-top: 2px;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent);
}

/* Fade-in */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile */
@media (max-width: 640px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        padding: 40px 0 32px;
        gap: 20px;
    }

    .profile-pic {
        width: 100px;
        height: 100px;
    }

    .header-text h1 {
        font-size: 24px;
    }

    .header-text h1 .name-jp {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 48px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 8px 24px;
    }

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

    .nav-links li {
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
    }

    .menu-toggle {
        display: block;
    }

    .cv-entry {
        flex-direction: column;
        gap: 2px;
    }

    .cv-date {
        width: auto;
    }
}
