:root {
    --background: image-set(url('/bg.avif') type('image/avif'), url('/bg.webp') type('image/webp'));
    font-weight: 500;
    line-height: 1.5;
    font-family: Inter, system-ui, sans-serif;
}

body {
    margin: 0 auto;
    min-width: 320px;
    max-width: min(1280px, 100% - 100px);
}

@media (width < 880px) {
    body {
        max-width: calc(100% - 50px);
    }
}

#bg {
    --multiplier: clamp(0, calc(-5 * var(--scroll, 0) + 1.5), 1);
    position: fixed;
    transform: translate(calc(var(--tx, 0) * var(--multiplier, 1)), calc(var(--ty, 0) * var(--multiplier, 1)));
    z-index: -1;
    filter: blur(clamp(0px, calc(50px * var(--scroll, 0) + -5px), 10px)) brightness(clamp(.7, calc(-.5 * var(--scroll, 0) + .85), .8));
    inset: -30px;
    background: #9af var(--background) center/cover no-repeat;
}

header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 50px;
    transform: translateY(-50%);
    margin-top: 45vh;
}

@media (width < 1300px) {
    header {
        margin-right: auto;
        margin-left: auto;
        max-width: 950px;
    }
}

@media (width < 880px) {
    header {
        flex-direction: column;
        gap: 20px;
        margin-right: auto;
        margin-left: auto;
        max-width: 480px;
    }
}

header img {
    animation: 1s ease-in-out .2s both avatar;
    border-radius: 50%;
    width: clamp(120px, 26vmin, 200px);
    height: clamp(120px, 26vmin, 200px);
    pointer-events: none;
}

@keyframes avatar {
    0% {
        transform: scale(.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

header section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header svg {
    -webkit-mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -10 550 100"><style>@keyframes dash{0%{stroke-dashoffset:727px;}to{stroke-dashoffset:0;};}@keyframes stroke-width{0%{stroke-width:3px;}to{stroke-width:12px;};}@keyframes fade{0%{opacity:0;}to{opacity:1;};}path{fill:none;stroke:%23fff;stroke-linecap:round;stroke-linejoin:round;stroke-width:3px;stroke-dasharray:727px;stroke-dashoffset:727px;animation:dash 1s cubic-bezier(.8,0,.2,1) var(--delay) forwards,stroke-width 1s cubic-bezier(.8,0,.2,1) calc(var(--delay) + .5s) forwards,fade .2s linear calc(var(--delay) + 0s) forwards;}</style><path d="M0 73.81 33.2.01l33.3 73.8m-54-20.7h41.6" style="--delay:0.3s"/><path d="M82 28.71v24.6q0 6.5 2.55 10.85t6.9 6.5q4.35 2.15 9.85 2.15 5.4 0 9.7-2.1 4.3-2.1 6.8-5.65 2.5-3.55 2.5-8.05v-28.3" style="--delay:0.5s"/><path d="M154 9.11v49.8q0 5.8 3.6 9.45 3.6 3.65 9.3 3.65h2.2m-29-43.3h29.1" style="--delay:0.7s"/><path d="M190 28.71v24.6q0 6.5 2.55 10.85t6.9 6.5q4.35 2.15 9.85 2.15 5.4 0 9.7-2.1 4.3-2.1 6.8-5.65 2.5-3.55 2.5-8.05v-28.3" style="--delay:0.9s"/><path d="M251 28.71v46.4-30.6q0-7 4.4-11.4t11.3-4.4q6.5 0 10.55 4.9 4.05 4.9 4.05 12.6v28.9-30.6q0-7 4.1-11.4 4.7-4.4 11.3-4.4 6.8 0 10.55 4.9 4.35 4.9 4.05 12.6l.3 28.9" style="--delay:1.1s"/><path d="M334 28.71v46.4-30.6q0-4.5 2.5-8.1 2.5-3.6 6.8-5.65 4.3-2.05 9.7-2.05 5.5 0 9.85 2.15t6.9 6.45q2.55 4.3 2.55 10.9v26.9" style="--delay:1.3s"/><path d="m388 .01 31.8 78.1L452 .01" style="--delay:1.5s"/><path d="M475 78.11V.01l56.1 78.1V.01" style="--delay:1.7s"/></svg>');
    backdrop-filter: saturate(2) brightness(2.5) blur(12px);
    width: min(500px, 100%);
}

header p {
    -webkit-mask: linear-gradient(to right, #fff 45%, transparent 55%) 0 0/220% 100% no-repeat;
    opacity: clamp(.7, .75 * var(--scroll, 0) + .7, .85);
    animation: 2s ease-in-out 1.9s both bio;
    color: #fff;
    font-weight: normal;
    font-size: clamp(18px, 3vmin, 25px);
}

@keyframes bio {
    0% {
        -webkit-mask-position: 100% 0;
    }

    100% {
        -webkit-mask-position: 0% 0;
    }
}

#arrow {
    display: flex;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    justify-content: center;
    transition: opacity .2s;
}

#arrow svg {
    opacity: .5;
    transition: opacity .2s;
    cursor: pointer;
    padding: 0 15px;
    width: 60px;
    height: 90px;
    color: #fff;
}

#arrow svg:hover {
    opacity: .8;
}

body[style*='.'] #arrow {
    opacity: 0;
    pointer-events: none;
}

#main {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 60px;
    opacity: calc(var(--scroll) / .15);
    margin-top: max(0px, calc(-140vh * var(--scroll) + 35vh));
    margin-bottom: calc(35vh - max(0px, calc(-140vh * var(--scroll) + 35vh)));
}

@media (width < 1300px) {
    #main {
        display: flex;
        flex-direction: column;
        gap: 40px;
        margin-right: auto;
        margin-left: auto;
        max-width: 950px;
    }
}

@media (width < 880px) {
    #main {
        margin-right: auto;
        margin-left: auto;
        max-width: 480px;
    }
}

main {
    --template-columns: 8;
    --gap: 40px;
    display: grid;
    grid-template-columns: repeat(var(--template-columns), 1fr);
    grid-column: span 8;
    gap: var(--gap);
    height: fit-content;
}

@media (width < 880px) {
    main {
        --template-columns: 4;
        --gap: 25px;
    }
}

.widget {
    --square-size: calc((((min(1280px, 100vw - 100px) - (60px * 11)) / 12) * 8 + (60px - var(--gap)) * 7) / 8);
    --c: min(var(--columns, 2), var(--template-columns));
    --r: var(--rows, 2);
    grid-row: span var(--r);
    grid-column: span var(--c);
    transition: transform .2s linear, background-color .2s linear;
    border-radius: 24px;
    background-color: #defa;
    height: calc(var(--square-size) * var(--r) + var(--gap) * (var(--r) - 1));
    overflow: hidden;
    color: #000;
}

@media (width < 1300px) {
    .widget {
        --square-size: calc((min(950px, 100vw - 100px) - (var(--gap) * 7)) / 8);
    }
}

@media (width < 880px) {
    .widget {
        --square-size: calc((max(320px, min(480px, calc(100vw - 50px))) - (var(--gap) * 3)) / 4);
    }
}

.widget:hover {
    background-color: #defc;
}

.widget:active {
    transform: perspective(300px) translateZ(-10px);
}

.widget a {
    display: flex;
    flex-direction: row;
    box-sizing: border-box;
    padding: 24px;
    width: 100%;
    height: 100%;
    color: #000;
}

.widget a[href='#'] {
    pointer-events: none;
}

.widget a[aria-label] {
    box-sizing: border-box;
    padding: 0;
}

.widget a[aria-label] .image {
    background: var(--bg) center/contain no-repeat;
    width: 100%;
    height: 100%;
}

.widget .content {
    display: flex;
    flex-direction: column;
}

.widget .icon {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    overflow: hidden;
    color: #fff;
}

.widget .icon svg {
    width: var(--size, 70%);
    height: var(--size, 70%);
}

.widget .icon img {
    width: 100%;
    height: 100%;
}

.widget .meta {
    margin-top: 10px;
}

.widget[style*='--rows: 1;'] .content {
    flex-direction: row;
    align-items: center;
}

.widget[style*='--rows: 1;'] .meta {
    margin-top: 0;
    margin-left: 20px;
    white-space: nowrap;
}

@media (width < 880px) {
    .widget[style*='--m-'] {
        --c: min(var(--m-columns, 2), var(--template-columns));
        --r: var(--m-rows, 2);
    }
}

#github {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 18px 24px;
    width: 100%;
    height: 100%;
}

#github .line {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #000b;
}

#github svg {
    fill: #07c;
}

#github .title {
    flex: 0 0 14em;
}

#discord {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 24px;
    width: 100%;
    height: 100%;
}

#discord .content {
    flex-direction: row;
}

#discord .meta {
    margin-top: 0;
    margin-left: 14px;
}

#dot {
    display: inline-block;
    margin-right: .1em;
    border-radius: 50%;
    width: .6em;
    height: .6em;
}

#discord .rpc {
    display: flex;
    flex-direction: row;
    margin-top: 10px;
    white-space: nowrap;
}

#discord .rpc .meta {
    color: #000b;
}

#large_image {
    border-radius: 10px;
    background: var(--image) center/cover no-repeat;
    width: 72px;
    height: 72px;
}

#small_image {
    position: relative;
    top: -22px;
    left: 50px;
    border-radius: 50%;
    background: var(--image) center/cover no-repeat;
    width: 30px;
    height: 30px;
}

#clock {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    padding: 20px;
    width: 100%;
    height: 100%;
}

#clock .face {
    position: relative;
    aspect-ratio: 1/1;
    height: 100%;
}

#clock .face div,
#clock .face svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

#clock .face svg {
    fill: #adf;
}

#hour-hand::before,
#minute-hand::before,
#second-hand::before {
    position: absolute;
    bottom: 46%;
    left: 46%;
    border-radius: 50px;
    background-color: var(--color);
    width: 8%;
    height: var(--h);
    content: '';
}

#hour-hand {
    --h: 30%;
    --color: #36b;
}

#minute-hand {
    --h: 40%;
    --color: #48d;
}

#second-hand {
    --h: 8%;
    --color: #48d;
    transition: transform .2s;
}

#second-hand::before {
    top: 7%;
}

#clock .date {
    color: #000b;
    font-size: 1.2em;
}

#clock .time {
    min-width: 7ch;
    font-weight: bold;
    font-size: 2.5em;
}

#minute~span {
    color: #0006;
}

#timezone-diff {
    color: #000b;
}

#utc-offset {
    color: #0009;
}

aside {
    display: flex;
    grid-column: span 4;
    flex-direction: column;
    gap: 20px;
}

@media (width < 1300px) {
    aside {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (width < 880px) {
    aside {
        display: flex;
    }
}

.project {
    transition: transform .2s linear, background-color .2s linear;
    border-radius: 16px;
    background: #defa;
    overflow: hidden;
}

.project:hover {
    background-color: #defc;
}

.project:active {
    transform: perspective(300px) translateZ(-10px);
}

.project a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    box-sizing: border-box;
    padding: 15px 20px;
    width: 100%;
    height: 100%;
    color: #000;
}

.project b {
    color: #06b;
    font-size: 1.1em;
}

.project .meta {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    color: #000b;
}

.project .meta svg {
    fill: #000b;
}

.project .meta div {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.project .lang {
    flex: 1;
    justify-content: flex-end;
}

.project .lang .color {
    margin-right: .1em;
    border-radius: 50%;
    width: .6em;
    height: .6em;
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -35vh;
    height: 15vh;
    font-size: 20px;
}

footer p {
    opacity: .65;
    transition: opacity .2s;
    color: #fff;
    line-height: 2;
    text-align: center;
}

footer div:hover {
    opacity: .8;
}

footer a {
    transition: color .2s;
    color: #fff;
}

footer a:hover {
    color: #7df;
}

#os {
    position: fixed;
    inset: 0 0 0 auto;
    box-sizing: border-box;
    padding: 4px;
    width: 16px;
}

@media (width < 880px) {
    #os {
        display: none;
    }
}

#track {
    height: 100%;
    touch-action: none;
}

#handle {
    transition: background-color .2s;
    border-radius: 4px;
    background: #def6;
}

#handle:before {
    position: absolute;
    inset: -4px;
    content: '';
}

#handle:hover {
    background: #defa;
}

a {
    text-decoration: none;
}

b+p {
    color: #000b;
}

h1,
p {
    margin: 0;
}

html {
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none;
    user-select: none;
}

::-webkit-scrollbar {
    display: none;
}

@font-face {
    src: url('/font.woff2') format('woff2');
    font-family: Inter;
    font-display: swap;
}
