/* The homepage has its own composition; styles.css still serves the 404 page. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('/assets/fonts/inter-latin-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'UnifrakturCook';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/unifrakturcook-subset.woff2') format('woff2');
    unicode-range: U+0020-007E, U+2013-2014, U+2018-2019;
}

:root {
    color-scheme: dark;
    --text-color: #f1f7ff;
    --accent-color: #b8f6f5;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: #173fa2;
}

body {
    margin: 0;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-color);
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: color-drift 30s ease infinite;
    line-height: 1.5;
}

@keyframes color-drift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}


html:not(.retro) ::selection { color: #102b59; background: var(--accent-color); }

.container {
    width: min(100% - 40px, 620px);
    margin: auto;
    padding: 48px 0 20px;
}

.masthead {
    text-align: center;
    margin-bottom: 30px;
}

.name {
    margin: 0;
    font-family: 'UnifrakturCook', Georgia, serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 84px);
    letter-spacing: -.035em;
    line-height: 1.05;
    color: #edf7ff;
    text-shadow: 0 2px 0 rgb(15 38 100 / 20%), 0 12px 40px rgb(8 28 89 / 12%);
}

.domain { color: inherit; }

.content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}

.identity { text-align: center; }

.portrait-frame {
    width: 160px;
    aspect-ratio: 1;
    margin: 0 auto;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.portrait-frame:focus-visible { outline: 2px solid white; outline-offset: 6px; }


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

.chinese-name {
    margin: 20px 0 0;
    color: #d6e9ff;
    font-family: system-ui, sans-serif;
    font-size: 30px;
    font-weight: 400;
    letter-spacing: .3em;
    text-indent: .3em;
    text-shadow: 0 2px 0 rgb(15 38 100 / 20%), 0 12px 40px rgb(8 28 89 / 12%);
}

.social-links {
    display: grid;
    grid-auto-rows: 1fr;
    width: min(100%, 360px);
    margin: 0 auto;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    min-height: 64px;
    padding: 14px 18px;
    color: #fff;
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    text-shadow: 0 2px 8px rgb(0 0 0 / 30%);
    border-radius: 999px;
    background: rgb(255 255 255 / 9%);
    transition: background-color .2s ease, box-shadow .2s ease, transform .15s ease;
}


.social-link .icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: currentColor;
    transition: transform .2s ease;
}

.social-link:hover {
    background-color: rgb(255 255 255 / 19%);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 20%), 0 8px 22px rgb(0 0 0 / 10%);
}

.social-link:hover .icon { transform: rotate(-8deg) scale(1.12); }

.social-link:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; z-index: 1; }
.social-link:active { transform: translateY(2px); background: rgb(0 0 0 / 8%); box-shadow: inset 0 2px 8px rgb(0 0 0 / 15%); }
.social-link:active .icon { transform: none; }

.footer {
    width: min(100% - 96px, 1020px);
    margin: 0 auto;
    padding: 22px 0 30px;
    text-align: center;
}

.footer-text {
    margin: 0 auto;
    max-width: 650px;
    font-family: system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #d3e3ff;
}


@media (max-width: 400px) {
    .chinese-name { font-size: 26px; letter-spacing: .18em; text-indent: .18em; }
    .footer-text { font-size: 13px; }
}

/* Crossfade whole-page snapshots, without moving or resizing individual content. */
::view-transition-group(root) { animation: none; }
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 450ms;
    animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
    .social-link, .social-link .icon { transition: none; }
    .social-link:active, .social-link:hover .icon { transform: none; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

@media (forced-colors: active) {
    .social-link { border: 1px solid ButtonText; }
}

@media print {
    html, body { background: white; color: black; }
    .name, .domain, .chinese-name, .footer-text, .social-link, .social-link .icon { color: black; }
    .social-link { text-shadow: none; }
    .container { padding-top: 0; }
}

/* The portrait switches the same content to a deliberately plain early-web page. */
html.retro { background: white; color-scheme: light; }
.retro body {
    display: block;
    min-height: 0;
    margin: 8px;
    background: white;
    animation: none;
    color: black;
    font-family: "Times New Roman", Times, serif;
    line-height: normal;
}
.retro .container { width: auto; margin: 0; padding: 0; }
.retro .masthead { text-align: left; margin: 0; }
.retro .name {
    margin: .67em 0;
    font: bold 32px "Times New Roman", Times, serif;
    letter-spacing: normal;
    color: black;
    text-shadow: none;
}
.retro .chinese-name {
    margin: 1em 0;
    font-family: serif;
    font-size: 22px;
    color: black;
    text-shadow: none;
    letter-spacing: normal;
    text-indent: 0;
}
.retro .content { display: block; }
.retro .identity { text-align: left; margin: 1em 0; }
.retro .portrait-frame {
    display: inline;
    width: auto;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
    color: #0000ee;
    font: inherit;
    text-decoration: underline;
}
.retro .portrait-frame:focus-visible { outline: 1px dotted black; outline-offset: 2px; }
.retro .profile-image { display: block; width: 160px; height: auto; border-radius: 0; }
.retro .social-link .icon { display: none; }
.retro .social-links { display: block; width: auto; margin: 1em 0; }
.retro .social-link {
    display: block;
    min-height: 0;
    width: fit-content;
    max-width: 100%;
    margin: 1em 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-shadow: none;
    text-decoration: underline;
    font: inherit;
    color: #0000ee;
    transition: none;
    transform: none;
}
.retro .social-link:visited { color: #551a8b; }
.retro .social-link:active { color: #ff0000; }
.retro .social-link:focus-visible { outline: 1px dotted black; outline-offset: 2px; }
.retro .footer { width: auto; margin: 32px 0 0; padding: 0; text-align: left; }
.retro .footer-text { max-width: none; margin: 0; color: black; font: inherit; }
