/*
     ╱|、
    (˚ˎ 。7  
     |、˜〵          
     じしˍ,)ノ
    welcome to my 
    highly unoptimized
    stylesheet
*/

@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tomorrow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');


:root {
    --primary-color: #FFFFFF;
    --secondary-color: #ECECEC;
    --tertiary-color: #DEDEDE;
    --accent-color: #f13a3a;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--tertiary-color) var(--primary-color);
    cursor: url("../images/cursor.png"), auto;
    image-rendering: pixelated;
    font-size: clamp(16px, 0.9rem + 0.4vw, 20px);
}


html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: var(--primary-color);
}

html::-webkit-scrollbar-thumb {
    background: var(--tertiary-color);
    border-radius: 4px;
}

body {
    font-family:'Pixelify Sans', 'Pixelify Sans', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    overflow-x: clip;
    max-width: 100%;
}

main {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
}

p {
    color: #555555
}

hr {
    margin: 1.5rem 0rem
}

img {
    filter: grayscale(100%);
}

#topbar {
    position: fixed;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-color);
    padding: 0.75rem 1rem;
    z-index: 9999;
    
    nav ul {
        list-style: none;
        display: flex;

        gap: clamp(0.5rem, 1vw, 1rem);
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul :hover {
        color: var(--accent-color);
        transform: translateY(2px);
    }
    
    nav ul li a {
        color: black;
        text-decoration: none;
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        transition: background-color 0.2s, color 0.2s;
        white-space: nowrap;
    }
}

#top {
    background-color: var(--primary-color);
    background-image: url("../images/happy-overlay.png");
    background-size: contain;
    
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;

    min-height: 60vh;
    @media (min-width: 768px) {
        min-height: 100vh;
    }

    padding: 5rem 1rem 2rem;
    height: auto;

    h1 {
        font-size: clamp(1.5rem, 8vw, 4rem);
        overflow-wrap: anywhere;
    }

    p {
        font-size: 1.25em;
    }

    img {
        width: min(100%, 400px);
        max-height: 30vh;
        object-fit: contain;
        height: auto;

        animation: jostle 1.5s steps(2) infinite;
        cursor: url("../images/smiley-cursor.png"), auto;
    }
}

#stamps {
    margin: 2em;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, max-content);
    padding: 0;
    justify-content: center;
    gap: 8px;

    li {
        justify-self: center;
    }

    img {
        width: 20vw;
        max-width: 150px;
        height: auto;
        cursor: url("../images/smiley-cursor.png"), auto;
    }
}

.boxed {
    position: relative;
    border: 24px solid transparent;
    border-image-source: url("../images/squiggle-square.gif");
    border-image-slice: 24 fill;
    border-image-repeat: stretch;

    h1 {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    h1::after {
        content: "";
        flex: 1;
        height: 1px;
        background: linear-gradient(to right, black, transparent);
    }
}

.boxed::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  width: 20%;
  height: 2.5em;
  background: rgba(170, 170, 170, 0.4);
  transform: translateX(-50%) rotate(-3deg);
}

.lined {
    /* Image path */
    background-image: url("../images/lined-paper.jpg");
    background-repeat: repeat-y;
    background-size: 100% auto;
    width: 80%;
}

.boxed, .lined {
    margin: 2rem auto;
    padding: 2rem 1rem;

    /* extend line on h1 */
}

/* side decor ----------------------------------- */
.deco {
    position: absolute;
    z-index: 2;
    height: 50%;
    width: auto;
    cursor: url("../images/eye-cursor.png"), auto;
    pointer-events: visible;
    display: none;
}

#sticky-note {
    bottom: -20px;
    left: 100%;
    animation: jostle 1s steps(2) infinite;
}

#skrib-jump {
    top: 20px;
    left: 95%;
    animation: spin 50s linear infinite;
}

#computer-doodle {
    height: 80%;
    top: 10px;
    right: 100%;

    animation: jostle 2s steps(2) infinite;
}

#spinning-rat {
    height: 80%;
    bottom: -50px;
    right: 100%;
}

/* sections ------------------------------------- */

#who {
    .hobbies-images {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        
        img {
            width: 100%;
        }
    }
    
    @media (min-width: 768px) {
        transform: rotate(-1deg);
        margin-left: 5%;
    }
}

#what {
    @media (min-width: 768px) {
        transform: rotate(2deg); 
        margin-right: 5%;
    }
}

#projects {
    text-align: center;
    width: 95%;
}

#project-list {
    list-style: none;
    padding: 0;
    margin: 2rem auto 0;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;

    @media (min-width: 768px) {
        grid-template-columns: repeat(2, 1fr);
        img { width: 40%; }
    }
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    
    padding: 1rem 10%;

    color: inherit;
    background: var(--primary-color);
    border: 2px solid var(--tertiary-color);
    box-shadow: 0px 4px 0 var(--tertiary-color);
    
    a {
        color: inherit;
        text-decoration: none;
    }
    
    img {
        width: 20%;
    }
}

.project-card:hover {
    transform: translateY(5px);
    background-color: var(--secondary-color);
}

.project-card:nth-child(odd) {
    transform: rotate(2deg);
}

.project-card:nth-child(even) {
    transform: rotate(-1deg);
}

.project-card:nth-child(3n) {
    transform: rotate(1deg);
}


.project-card::before {
    content: "";
    position: absolute;
    left: 0%;
    width: 15%;
    height: 2em;
    background: rgba(170, 170, 170, 0.4);
    
    transform: translateX(-50%) translateY(-100%) rotate(-45deg);
}

.project-card::after {
    content: "";
    position: absolute;
    right: 0%;
    bottom: 20px;
    width: 15%;
    height: 2em;
    background: rgba(170, 170, 170, 0.4);
    
    transform: translateX(50%) translateY(100%) rotate(-45deg);
}

#socials {
    width: 90%;
    text-align: center;

    h1 {
        display: block;
    }

    h1::after {
        flex: 0;
        display: none;
    }
}

#social-list {
    list-style: none;
    display: flex;
    justify-content:center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;

    margin-top: 1em;

    img, svg {
        width: 3rem;
        height: 3rem;
        object-fit: contain;
    }

    li:hover {
        transform: translateY(5px);
    }
}


/* animation stuff ------------------------------ */ 
@keyframes shake {
  0%, 100% { transform: translate(0, 0) }
  20% { transform: translate(-2px, 1px)  }
  40% { transform: translate(2px, -1px) }
  60% { transform: translate(-2px, -1px) }
  80% { transform: translate(2px, 1px) }
}

@keyframes jostle {
    from {
        transform: rotate(-4deg);
    }

    to {
        transform: rotate(8deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.scroll-animated {
    opacity: 0;
    translate: 0 100px;
    rotate: 4deg;
    transition: opacity 0.8s ease,
                translate 0.8s cubic-bezier(0.075, 0.82, 0.165, 1),
                rotate 0.8s cubic-bezier(0.075, 0.82, 0.165, 1)
}

.scroll-animated.visible {
    opacity: 1;
    translate: 0 0;
    rotate: 0deg;
}

/* media queries -------------------------------- */
@media (min-width: 768px) {
    .boxed {
        width: 70%;
    }

    .deco { 
        display: inline;
    }
}


@media (prefers-reduced-motion: reduce) {
    .scroll-animated { opacity: 1; translate: none; rotate: none; transition: none; }
}