:root {
    --maxTextWidth: 1000px;
    --line-height:1.28em;
    --margin:24px;
    --stickyTop: 24px; /*placeholder value*/
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400&display=swap');

@font-face {
    font-family: "unstately";
    src: url("../fonts/Unstately.otf") format("opentype");
    font-weight:normal;
    font-style:normal;
}

@font-face {
    font-family: "runic";
    src: url("../fonts/Runic_Siri.otf") format("opentype");
    font-weight:normal;
    font-style:normal;
}

* {
    box-sizing:border-box;
    hyphens: auto;
    -ms-hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    
    font-weight:normal;
}

html {
    font-size: clamp(16px, 10vw, 24px);
}

body {
    font-family: "runic";
    line-height:var(--line-height);
    letter-spacing:.75px;
    position:relative;
    margin:0;
    padding:0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
}

span.chinese {
    font-family: "Noto Serif SC", serif;
    font-weight: 300;
    font-style: normal;
}

img, video, iframe {
    max-width:100%;
    max-height:100%;
}

iframe {
    width:100%;
    aspect-ratio: 16 / 9;
}

a {
    color: rgb(181, 0, 181);
    text-decoration: underline wavy 2px;
    text-underline-offset:.15em;
}

a:visited, .header a {
    color:slategray;
}

.icon a, .header a {
    text-decoration:none;
}

p {
    margin: 1em 0;
}

.project:first-of-type, p:first-of-type, .icons + p {
    margin: 0 0 1em 0;
}

p:last-of-type {
    margin-bottom:0;
}

/*!temporarily nullifying italics since runic.otf doesn't have italics!*/
i, em {
    font-style:normal;
}


/* SECTIONS */
.main {
    position:relative;
    width:100%;
    height:100dvh;
    overflow: hidden; /* Disable scroll until init() runs, otherwise user can scroll before JS sets correct padding and stickyTop, causing layout issues */

    padding:0 0 var(--margin) 0;

    display:grid;
    grid-template-columns: 1fr;
    gap: 0;
    justify-content:center;
    justify-items: center;

}

.main::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.main::-webkit-scrollbar-track {
    background: rgb(233, 233, 233);
    border-radius: 0; /* Square corners */
}

.main::-webkit-scrollbar-thumb {
    background: rgb(218, 218, 218);
    border-radius: 0; /* Square corners */
}

.main > * {
    width:100%;
    max-width: var(--maxTextWidth);
}

/* STICKY */
.constant, .stickyContainer {
    position: sticky;
}

.constant {
    z-index: 100; /*So that when footer scrolls up, it's hidden beneath .constant*/
    top:0;
    padding:var(--margin) 0; /* Need to incorporate padding inside .constant so that when footer scrolls up behind it, it isn't visible*/
}

.stickyContainer:nth-of-type(2) {
    top: calc(var(--stickyTop));
}

.stickyContainer {
    /* position: relative; */
    top:var(--stickyTop);
    margin: 0 0 var(--margin) 0;
}

.sticky_bg {
    background: white;
}

/* ICONS */
.icon {
    display:inline;
}

.icon * {
    width:auto;
    height:auto;
    max-height:10em;
    max-width:14em;
}



/* FOOTER */
footer {
    width:100%;
    display:grid;
    justify-items: center;
}

.footer-header {
    display:block;
    font-size:.55rem;
}

.footer-gallery {
    max-width: var(--maxTextWidth);
    display:grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: auto;
    gap: var(--margin);
    justify-items:center;
    align-items:start;
    transition: all 0.3s ease;
}

footer img {
    width: 100%;
    height:auto;
    object-fit: contain;
}


/* MEDIA QUERIES */
@media screen and (max-width: 1200px) {
    .main {
        padding: 0 var(--margin) var(--margin) var(--margin);
    }
}

@media screen and (max-width: 1000px) {
    .footer-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 800px) {
    .icon img, .icon video {
        max-height:8em;
        max-width:12em;
    }
}

@media screen and (max-width: 480px) {
    :root {
        --margin:16px;
        --stickyTop: 16px; /*placeholder value*/
    }

    html {
        font-size: 16px;
    }

    .icon img, .icon video {
        max-height:6em;
        max-width:10em;
    }

    .footer-gallery {
        gap: calc(var(--margin) / 2);
        grid-template-columns: repeat(2, 1fr);
    }
}

