@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('/assets/fonts/MaterialIcons-Regular.woff2') format('woff2');
}

:root {
    font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    color: #303334;
    background: #e6e9e7;
    --sidebar-width: 270px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at 75% 20%, #f2eee1, transparent 65%), linear-gradient(135deg, #c9d6d2, #e5e9e3 55%, #c5d4d7);
    background-attachment: fixed;
}

a {
    color: #107dbc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
mdui-button {
    cursor: pointer;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 12px 0 20px;
}

p {
    line-height: 1.8;
}

mdui-card {
    display: block;
}

mdui-icon {
    font-family: 'Material Icons';
}

#sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    z-index: 20;
    transition: transform .3s ease;
}

.sidebar-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, .5);
    backdrop-filter: blur(16px);
    overflow-y: auto;
}

.sidebar-header {
    margin: 10px 20px;
}

.sidebar-header h2 {
    font-size: 24px;
}

.site-note {
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, .55);
}

nav {
    flex: 1;
}

mdui-list-item {
    padding-left: 10px;
}

.sidebar-footer {
    padding: 20px;
    font-size: 12px;
    line-height: 24px;
}

.sidebar-footer p {
    margin-bottom: 24px;
}

.sidebar-footer img {
    vertical-align: -3px;
    margin-right: 3px;
}

#sidebar-toggle {
    position: absolute;
    left: 100%;
    top: 0;
    width: 50px;
    min-width: 50px;
    height: 50px;
    border-radius: 0 20px 20px 0;
    background: rgba(255, 255, 255, .68);
}

#app {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    outline: none;
    transition: margin-left .3s ease;
}

body.sidebar-closed #sidebar {
    transform: translateX(-100%);
}

body.sidebar-closed #app {
    margin-left: 0;
}

.home-page {
    position: relative;
    min-height: 100vh;
    padding: 15vh clamp(28px, 8vw, 160px) 210px;
}

.welcome-card {
    padding: 24px 28px;
    max-width: 380px;
    background: rgba(255, 255, 255, .72);
    border-radius: 16px;
}

.welcome-card h1 {
    font-size: 32px;
}

.welcome-card mdui-button {
    margin-top: 12px;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: .1em;
    color: #596d66;
}

.home-note {
    position: absolute;
    bottom: 0;
    right: 0;
    max-width: 380px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, .58);
    border-radius: 16px 0 0 0;
}

.home-note p {
    font-size: 12px;
    margin: 4px 0;
}

.home-note h2 {
    font-size: 18px;
    margin: 6px 0;
}

.projects-page {
    max-width: 1040px;
    margin: auto;
    padding: 56px 36px;
    font-size: 13px;
}

.page-heading {
    margin-bottom: 24px;
}

.projects-page .page-heading h1 {
    margin: 8px 0 12px;
    font-size: clamp(26px, 3vw, 34px);
}

.projects-page .page-heading p {
    margin: 8px 0;
}

.projects-page .eyebrow {
    font-size: 11px;
}

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

.project-card {
    padding: 20px;
    background: rgba(255, 255, 255, .72);
    border-radius: 16px;
}

.project-card>mdui-icon {
    font-size: 24px;
    color: #586f65;
}

.project-card h2 {
    margin: 12px 0 8px;
    font-size: 18px;
}

.project-card p {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #59605d;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 60px;
    z-index: 40;
    padding: 12px;
    background: white;
}

.skip-link:focus {
    top: 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#backdrop {
    position: fixed;
    inset: 0;
    background: #0005;
    border: 0;
    z-index: 15;
}

#app[aria-busy=true] {
    opacity: .65;
}

@media(max-width:760px) {
    #app {
        margin-left: 0;
    }

    .projects-page {
        padding: 72px 20px 28px;
    }

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

    .home-page {
        padding: 100px 24px 230px;
    }

    .welcome-card {
        max-width: 100%;
    }

    .home-note {
        max-width: calc(100% - 24px);
    }

    .sidebar-main {
        background: rgba(255, 255, 255, .6);
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* Old homepage wallpaper, floating source switch and bottom-right caption. */
.home-page {
    isolation: isolate;
}

#home {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-repeat: no-repeat;
    pointer-events: none;
}

#float_switch {
    position: fixed;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    max-width: calc(100vw - 60px);
    min-height: 48px;
    z-index: 5;
    background: rgba(255, 255, 255, .8);
    backdrop-filter: blur(12px);
    border-radius: 0 0 0 20px;
    transform: translateX(calc(100% - 48px));
    transition: transform .3s ease;
}

#float_switch.is-open {
    transform: translateX(0);
}

#wallpaper-tools-toggle {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
}

#wallpaper-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding-right: 8px;
    overflow-x: auto;
}

#wallpaper-tools mdui-button {
    flex-shrink: 0;
    white-space: nowrap;
}

#wallpaper-spinner {
    position: fixed;
    right: 16px;
    top: 60px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .8);
}

#wallpaper-spinner[hidden] {
    display: none;
}

#wallpaper-spinner mdui-circular-progress {
    width: 24px;
    height: 24px;
}

.home-page .welcome-card {
    background: rgba(255, 255, 255, .75);
}

.home-note {
    position: fixed;
    bottom: 5px;
    right: -2px;
    width: 380px;
    max-width: calc(100vw - 24px);
    padding: 12px 16px 12px 20px;
    border-radius: 0;
    background: rgba(255, 255, 255, .65);
    z-index: 5;
}

.wallpaper-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px;
    font-size: 12px;
    line-height: 1.5;
}

.wallpaper-info>:nth-child(-n+4) {
    grid-column: span 2;
}

.wallpaper-info h2 {
    font-size: 16px;
    margin: 0;
    line-height: 25px;
}

.wallpaper-info>:last-child {
    text-align: right;
}

.wallpaper-info a {
    color: inherit;
}

.wallpaper-info a[href]:hover {
    color: rgb(var(--mdui-color-primary));
}

#wallpaper-status {
    position: fixed;
    right: 16px;
    top: 54px;
    z-index: 5;
    max-width: calc(100vw - 80px);
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .85);
    font-size: 12px;
}

#wallpaper-status:empty {
    display: none;
}

mdui-card[hidden],
mdui-button[hidden] {
    display: none;
}

#bottom_text {
    margin: 0;
    line-height: 1.6;
    font-size: 12px;
    min-width: 0;
}

#bottom_text p {
    margin: 0;
}

.sidebar-text-switch {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    text-align: left;
    cursor: default;
}

.sidebar-text-switch:hover {
    color: rgb(var(--mdui-color-primary));
}

.sidebar-music {
    display: block;
    width: 100%;
    height: 76px;
    border: 0;
}

.welcome-card[clickable],
.home-note[clickable] {
    cursor: context-menu;
}

.site-note[clickable] {
    cursor: default;
}

@keyframes wallpaper-text-enter {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-note.content-enter .wallpaper-info>* {
    animation: wallpaper-text-enter 400ms ease-out both;
}

.home-note.content-enter [data-field="headline"] {
    animation-delay: 0ms;
}

.home-note.content-enter [data-field="series"] {
    animation-delay: 60ms;
}

.home-note.content-enter [data-field="description"] {
    animation-delay: 120ms;
}

.home-note.content-enter [data-field="location"] {
    animation-delay: 180ms;
}

.home-note.content-enter [data-field="timestamp"],
.home-note.content-enter [data-field="copyright"] {
    animation-delay: 240ms;
}

@media(prefers-reduced-motion:reduce) {
    .home-note.content-enter .wallpaper-info>* {
        animation: none;
    }
}

.sidebar-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    grid-template-rows: auto 24px;
    gap: 6px 8px;
    margin-bottom: 8px;
    align-items: end;
}

.sidebar-bottom-grid #bottom_text {
    grid-column: 1 / -1;
    grid-row: 1;
}

.sidebar-footer #count {
    grid-column: 1;
    grid-row: 2;
    height: 24px;
    margin: 0;
    line-height: 24px;
    white-space: nowrap;
    font-size: 12px;
}

.sidebar-bottom-grid.has-music {
    grid-template-rows: 46px 24px;
}

.sidebar-bottom-grid.has-music #bottom_text {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: stretch;
}

.sidebar-bottom-grid.has-music .sidebar-music {
    height: 100%;
}

.home-page .welcome-card {
    width: 100%;
    max-width: 320px;
    padding: 18px 22px;
    font-size: 12px;
    border-radius: 14px;
}

.home-page .welcome-card .eyebrow {
    font-size: 10px;
    margin: 0 0 8px;
}

.home-page .welcome-card h1 {
    font-size: 26px;
    margin: 8px 0 14px;
}

.home-page .welcome-card p {
    font-size: 14px;
    margin: 8px 0;
    line-height: 1.45;
}

.home-page .welcome-card mdui-button {
    margin-top: 8px;
    height: 34px;
    font-size: 12px;
}

.project-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.project-links .project-online {
    margin-left: auto;
}

.project-links mdui-button {
    height: 32px;
    font-size: 12px;
}

.project-links mdui-button-icon {
    width: 36px;
    height: 36px;
}

.project-links mdui-button-icon svg {
    width: 20px;
    height: 20px;
}
