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

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

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

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

.bold {
    font-weight: 700;
}

a .bold~div,
a .bold~span {
    opacity: .7;
}

a,
#arrow {
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

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

html {
    scrollbar-width: none;
    user-select: none;
}

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

#background {
    position: fixed;
    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-color: #222;
}

#background:not(.touch-device) {
    --multiplier: clamp(0, calc(-5 * var(--scroll, 0) + 1.5), 1);
    transform: translate(calc(var(--tx, 0) * var(--multiplier, 1)), calc(var(--ty, 0) * var(--multiplier, 1)));
}

#background>div {
    position: absolute;
    inset: 0;
    background: var(--background) center/cover no-repeat;
}

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

header>img {
    animation: 1s ease-in-out .2s both avatar;
    border-radius: 50%;
    aspect-ratio: 1/1;
    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>div {
    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 span {
    -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: 400;
    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 .25s;
    cursor: pointer;
    padding-right: .25em;
    padding-left: .25em;
    width: 1em;
    height: 1.5em;
    color: #fff;
    font-size: min(60px, 12vw);
}

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

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

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

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

main>div {
    --c: min(var(--columns, 2), var(--template-columns));
    --r: var(--rows, 2);
    grid-row: span var(--r);
    grid-column: span var(--c);
    opacity: var(--opacity);
    transition: transform .15s linear;
    border-radius: 24px;
    background-color: var(--card);
    width: calc(var(--square-size) * var(--c) + var(--gap) * (var(--c) - 1));
    height: calc(var(--square-size) * var(--r) + var(--gap) * (var(--r) - 1));
    overflow: hidden;
    touch-action: manipulation;
    color: #000;
}

aside>div:active,
main>div:active {
    transform: perspective(300px) translateZ(-10px);
}

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

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

main a>div {
    display: flex;
    flex-direction: column;
}

.icon {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background-color: var(--bg);
    aspect-ratio: 1/1;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    overflow: hidden;
    color: #fff;
}

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

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

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

main .meta>.bold+div {
    font-size: .9em;
}

[style*='--rows: 1;']>a {
    align-items: center;
}

[style*='--rows: 1;']>a>div {
    flex-direction: row;
    align-items: center;
}

[style*='--rows: 1;'] .icon {
    width: 35px;
    min-width: 35px;
    height: 35px;
    min-height: 35px;
}

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

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

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

#big,
#small {
    background: var(--image) center/cover no-repeat;
}

#big {
    border-radius: 10px;
    width: 72px;
    height: 72px;
}

#small {
    position: relative;
    top: -22px;
    left: 50px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
}

[aria-label] {
    box-sizing: border-box;
    background-color: var(--bg-color);
    padding: var(--padding);
    width: 100%;
    height: 100%;
}

[aria-label]>div {
    border-radius: 10px;
    background: var(--fallback) center/contain no-repeat;
    background: var(--bg) center/contain no-repeat;
    width: 100%;
    height: 100%;
}

#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%;
}

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

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

#face>svg {
    fill: var(--clock);
}

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

#hour-hand {
    --w: 8%;
    --h: 30%;
    --color: #036;
}

#minute-hand {
    --w: 8%;
    --h: 40%;
    --color: #069;
}

#second-hand {
    --color: #269;
    transition: transform .2s;
}

#second-hand::before {
    position: absolute;
    top: 6.5%;
    left: 45.25%;
    border-radius: 50px;
    background-color: var(--color);
    width: 9.5%;
    height: 9.5%;
    content: '';
}

#minute~span {
    opacity: .4;
}

#utc-offset {
    opacity: .6;
}

#timezone-diff,
footer span:hover {
    opacity: .8;
}

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

aside>div {
    opacity: var(--opacity);
    transition: transform .15s linear;
    border-radius: 16px;
    background: var(--card);
    overflow: hidden;
}

aside 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;
}

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

aside .meta {
    display: flex;
    flex-direction: row;
    gap: 10px;
    opacity: .7;
    width: 100%;
}

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

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

.lang>span {
    margin-right: .1em;
    border-radius: 50%;
    aspect-ratio: 1/1;
    width: .6em;
    height: .6em;
}

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

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

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

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

.os {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    padding: 4px;
    width: 16px;
}

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

.handle {
    transition: opacity .15s, background-color .15s, border-color .15s, width .15s;
    border-radius: 4px;
    background: #def6;
    min-height: 33px;
}

.handle:before {
    position: absolute;
    top: -4px;
    right: -4px;
    bottom: -4px;
    left: -4px;
    content: '';
}

.handle:hover {
    background: #def9;
}

.handle:active {
    background: #defb;
}

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

    #grid {
        display: flex;
        flex-direction: column;
        gap: 40px;
        margin-right: auto;
        margin-left: auto;
        max-width: 950px;
    }

    aside {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    header {
        flex-direction: column;
        gap: 20px;
        margin-right: auto;
        margin-left: auto;
        max-width: 480px;
    }

    #grid {
        margin-right: auto;
        margin-left: auto;
        max-width: 480px;
    }

    main {
        --template-columns: 4;
        gap: 25px;
    }

    [style*='--mobile-aspect-ratio'] {
        aspect-ratio: var(--mobile-aspect-ratio);
        height: unset;
    }

    [style*='--m-'] {
        --c: min(var(--m-columns, 2), var(--template-columns));
        --r: var(--m-rows, 2);
    }

    [style*='--mobile-height'] {
        height: var(--mobile-height);
    }

    aside {
        display: flex;
    }
}
