:root {
    --grey: rgb(90, 90, 90);
    --blue1: rgb(2, 33, 105);
    --blue3: rgb(0, 114, 206);
    --rule: #ddd;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 70px;
}

body {
    margin: 0;
    background: #fff;
    color: var(--grey);
    font-family: 'Source Sans Pro', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 100%;
    font-weight: 300;
    letter-spacing: 0.5px;
    line-height: 1.45;
}

p { margin: 0.2em 0; }

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

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

a:hover { text-decoration: underline; }

a:focus-visible {
    outline: 2px solid var(--blue3);
    outline-offset: 2px;
}

h1 {
    font-weight: 400;
    color: var(--blue1);
}

b { font-weight: 600; }

/**************************************************/

#page {
    max-width: 1000px;
    margin: 0 auto;
}

#header {
    position: sticky;
    top: 0;
    z-index: 9999;
    display: flex;
    justify-content: space-around;
    line-height: 2em;
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule);
    background-color: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

#header a {
    color: var(--grey);
    transition: color 0.3s ease;
}

#header a:hover {
    color: var(--blue3);
    text-decoration: none;
}

/**************************************************/

#profile {
    padding: 50px 30px 10px 30px;
    border-bottom: 1px solid var(--rule);
}

#profile-pic {
    width: 280px;
    float: left;
    margin-right: 40px;
    text-align: center;
}

#profile-pic img {
    display: block;
    width: 100%;
    object-fit: cover;
}

#profile-name {
    font-size: 2.5em;
    line-height: 1em;
    font-weight: 400;
    margin-bottom: 10px;
    color: var(--blue1);
    text-align: center;
}

#profile-email {
    margin-bottom: 20px;
    color: var(--blue1);
    text-align: center;
}

#profile-email a { color: inherit; }

.name-zh { white-space: nowrap; }

#profile-links {
    margin: -12px 0 20px;
    text-align: center;
}

#profile p { margin-bottom: 20px; }

.section { padding: 0 30px 20px; }

.section li { margin-bottom: 0.3em; }

.updates li {
    display: grid;
    grid-template-columns: 8.5em 1fr;
    column-gap: 0.5em;
}

.updates b { white-space: nowrap; }

.project-meta { margin-bottom: 0.8em; }

.divider {
    width: 100%;
    border-bottom: 1px solid var(--rule);
}

.project { margin-bottom: 2em; }

.project::after {
    content: "";
    display: block;
    clear: both;
}

.research-thumb {
    width: 20em;
    float: left;
    margin-top: 7px;
    padding-right: 30px;
    margin-bottom: 20px;
}

.research-thumb img {
    display: block;
    width: 100%;
}

.more { margin-top: 0.4em; }

.more summary {
    display: inline-block;
    color: var(--blue3);
    cursor: pointer;
    list-style: none;
}

.more summary::-webkit-details-marker { display: none; }

.more summary::after { content: " \25BE"; }

.more[open] summary::after { content: " \25B4"; }

.more summary:hover { text-decoration: underline; }

.more summary:focus-visible {
    outline: 2px solid var(--blue3);
    outline-offset: 2px;
}

.more p { margin-top: 0.4em; }

.research-proj-title {
    color: var(--blue1);
    font-weight: 400;
}

.center { text-align: center; }

/* Footer */

#footer {
    padding: 16px 30px 24px;
    font-size: 0.8em;
    color: #999;
}

/* Fish button */

#fish-button {
    /* Bigger tap target without changing the layout */
    padding: 8px;
    margin: -8px;
    -webkit-tap-highlight-color: transparent;
    border: 0;
    background: none;
    font: inherit;
    font-size: 1.2em;
    line-height: inherit;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#fish-button:hover { transform: rotate(-12deg) scale(1.15); }

#fish-button:focus-visible {
    outline: 2px solid var(--blue3);
    outline-offset: 2px;
}

.fish-fx {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    will-change: transform;
}

.fish-fx-fish { left: 0; line-height: 1; }

.fish-fx-bubble {
    top: 100vh;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 114, 206, 0.55);
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(0, 114, 206, 0.15));
}

/* Friends */

.friends {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 1.5em;
    margin-top: 0.6em;
}

/* Photos */

.photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 800px;
}

.photos figure { margin: 0; }

.photos img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    margin-bottom: 0.6em;
}

/* Music page */

.tracks iframe {
    display: block;
    width: 100%;
    border: 0;
    margin: 0 0 1em;
}

.tracks figure { margin: 0 0 1.25em; }

.tracks figcaption {
    color: var(--blue1);
    font-weight: 400;
    margin-bottom: 0.35em;
}

.tracks audio {
    display: block;
    width: 100%;
}

/**************************************************/

@media (max-width: 760px) {
    #header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0 16px;
        padding-left: 16px;
        padding-right: 16px;
        line-height: 1.8em;
    }
    #profile { padding: 32px 16px 10px; }
    #profile-pic {
        float: none;
        width: 60%;
        max-width: 240px;
        margin: 0 auto 24px;
    }
    .section { padding: 0 16px 16px; }
    .updates li { display: block; margin-bottom: 0.7em; }
    .updates b { display: block; }
    .photos { grid-template-columns: 1fr; gap: 24px; }
    .research-thumb {
        float: none;
        width: 100%;
        padding-right: 0;
    }
}
