:root {
    font-weight: 500;
    line-height: 1.5;
    font-family: Inter, system-ui, sans-serif;
    --background: url('./public/bg.jpg');
}

a {
    text-decoration: none;
}

img {
  pointer-events: none;
}

b+p {
    color: #d4dae0;
}

h1,
p {
    margin: 0;
}

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

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

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: #3c3c3c var(--background) center/cover no-repeat;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.80);
    color: #FFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.hidden {
    opacity: 0;
    visibility: hidden;
}

header {
    display: flex;
    flex-direction: row;
    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;
        align-items: center;
    }
}

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;
    align-items: center;
    animation: 1s ease-in-out .2s both bio;
}

header h1 {
    color: #ffffff;
    animation: 1s ease-in-out .2s both avatar;
    font-size: clamp(36px, 6vmin, 50px);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header p {
    -webkit-mask: linear-gradient(to right, #fff 45%, transparent 55%) 0 0/220% 100% no-repeat;
    opacity: clamp(.9, .95 * var(--scroll, 0) + .9, .5);
    animation: 2s ease-in-out 1s both bio;
    color: #fff;
    font-weight: bold;
    padding: 6px;
    font-size: clamp(18px, 3vmin, 25px);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

@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: flex;
    flex-direction: column;
    gap: 55px;
    margin-right: auto;
    margin-left: auto;
    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 {
        gap: 40px;
        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: rgba(13, 17, 23, 0.855);
    height: calc(var(--square-size) * var(--r) + var(--gap) * (var(--r) - 1));
    overflow: hidden;
    color: #F0F6FC;
}

@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);
    }
}

@media (width < 480px) {
    p {
        font-size: 13px;
    }
}

.widget:hover {
    background-color: rgba(19, 24, 31, 0.7);
}

.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: #F0F6FC;
}

.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: #F0F6FC;
}

.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);
    }
}

.tech_stack {
    padding: 15px 20px;
}

.tech_stack h2,
.tech_stack h3 {
    margin: 5px;
}
