* {
    box-sizing: border-box;
}

@font-face {
    font-family:Material Design Icons;
    font-style:normal;
    font-weight:400;
    src:url(/assets/fonts/materialdesignicons-webfont.9c4a470c.eot) format("embedded-opentype"),
    url(/assets/fonts/materialdesignicons-webfont.66e43f0f.woff2) format("woff2"),
    url(/assets/fonts/materialdesignicons-webfont.c2df65ff.woff) format("woff"),
    url(/assets/fonts/materialdesignicons-webfont.e9f2f143.ttf) format("truetype")
}

html {
    --text-c-main: #212529;
    --text-c-second: #212529bf;
    --link-c: #0d6efd;
    --header-link-c: #6c757d;
    --header-link-c-hover: #565E64;
    --header-link-ul-hover: #777777;
    --line-height: 1.5;

    --bg-c: #ffffff;
    --bg-c-subtle: #f8f9fa;
    --bg-c-off: #f2f3f4;

    --border-c: #dee2e6;
    --border-c-second: #cdd1d3;
    --border-radius: 0.375rem;

    --btn-c-hover: #d5d8da;

    --h1-size: calc(1.25rem + 1.5vw);
    --h2-size: calc(1.25rem + 0.9vw);
    --h3-size: calc(1.15rem + 0.3vw);

    font-family: -apple-system,BlinkMacSystemFont,Roboto,Segoe UI,Helvetica Neue,Noto Sans,Noto Sans CJK SC,Microsoft YaHei,PingFang SC,微软雅黑,sans-serif;
    
}

main {
    animation: fadein 0.35s;
    animation-delay: 0.15s;
    animation-fill-mode: both;
}
@keyframes fadein {
    from { filter: opacity(0%) }
    to   { filter: opacity(100%) }
}

@media only screen and (min-width: 601px) {html{--page-width: clamp(0px, 1150px, calc(90% - 1rem))}}
@media only screen and (max-width: 600px) {html{--page-width: calc(100% - 2rem)}}

.button, .back-button, .tag {
    -webkit-touch-callout: none; /* iOS Safari */
      -webkit-user-select: none; /* Safari */
       -khtml-user-select: none; /* Konqueror HTML */
         -moz-user-select: none; /* Old versions of Firefox */
          -ms-user-select: none; /* Internet Explorer/Edge */
              user-select: none; /* Non-prefixed version, currently
                                    supported by Chrome, Edge, Opera and Firefox */
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    justify-content: space-between;
    align-items: center;
}

main {
    height: 100%;
    width: var(--page-width);
    padding-top: 2rem;
    flex-grow: 1;

    /* display: flex;
    flex-direction: column;
    justify-content: space-between; */
    /* position: relative; */
}

/* Tags */
h1, h2, h3 {
    font-weight: 500;
    margin: 0 0 0.5rem 0;
}
h1 { font-size: clamp(1.25rem, var(--h1-size), 2.5rem) }
h2 { font-size: clamp(1.15rem, var(--h2-size), 2rem) }
h3 { font-size: clamp(1.15rem, var(--h3-size), 1.75rem) }

p, span {
    margin-top: 0;
    line-height: var(--line-height);
}

hr {
    margin: 1rem 0 2.25rem;
    border: 0;
    border-top: 1px solid var(--border-c);
}

/* Classes */

/* Infocards */
.card {
    border: 1px solid var(--border-c-second);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.card > a {
    overflow: hidden;
    line-height: 0;
}
.card > a > img {
    width: 100%;
    transition: 0.25s;
}
.card > a > img:hover {
    transform: scale(1.05);
}
.card > .card-footer {
    background-color: var(--bg-c-subtle);
    border-top: 1px solid var(--border-c-second);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.card > .card-body {
    width: 100%;
    padding: 1rem;
    flex-grow: 1;

}
.card-body a, .card-body a:visited {
    color: var(--link-c);
}

/* Buttons */
.button {
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--text-c-main);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    transition: 0.25s;
}
.button:hover {
    background-color: var(--btn-c-hover);
    border-color: var(--border-c-second);
}

/* Infocard grids */
.card-grid {
    display: grid;
    grid-gap: 2rem .75rem;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    /* align-items: start; */
    margin-bottom: 4.5rem;
}
.card-grid > .card {
    max-width: 600px;
}
@media only screen and (max-width: 600px) {
    .grid-shrink > .card {
        display: none;
    }
    .grid-shrink > .card:first-child {
        display: flex;
    }
}

/* Back button */
.back-button {
    display: inline-flex;
    text-decoration: none;
    color: var(--text-c-main);
    padding: 0.375rem 0.75rem 0.375rem 0.25rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    transition: 0.25s;
    align-items: center;
    margin-bottom: 1rem;
}
.back-button:hover {
    background-color: var(--btn-c-hover);
    border-color: var(--border-c-second);
}
.back-button > img {
    transform: rotate(180deg) translateY(1px);
}

/* Container */
.image-beside-text {
    display: flex;
    flex-wrap: nowrap;
    align-items: start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
@media only screen and (max-width: 600px) { .image-beside-text { flex-direction: column } }

.column-align {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: start;
}

.introbox {
    background-color: var(--bg-c-off);
    border-radius: var(--border-radius);
    padding: 3rem;
    margin-bottom: 1rem;
}

.gap {
    padding: 1rem 0;
}

/* Image grid */

/* .image-grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    justify-items: stretch;
} */

/* Image grid from css-tricks: "https://css-tricks.com/seamless-responsive-photo-grid/" */

.image-grid {
    display: block;
    line-height: 2.5;
    -webkit-column-count: 3;
    -webkit-column-gap: 0.75rem;
    -moz-column-count: 3;
    -moz-column-gap: 0.75rem;
    column-count: 3;
    column-gap: 0.75rem;
}

.image-grid > img {
    border-radius: 0.65rem;
    width: 100%;
    height: auto;
}

/* @media (max-width: 1200px) {
    .image-grid {
        -moz-column-count: 4;
        -webkit-column-count: 4;
        column-count: 4;
    }
} */
@media (max-width: 1000px) {
    .image-grid {
        -moz-column-count: 3;
        -webkit-column-count: 3;
        column-count: 3;
    }
}
@media (max-width: 800px) {
    .image-grid {
        -moz-column-count: 2;
        -webkit-column-count: 2;
        column-count: 2;
    }
}
@media (max-width: 400px) {
    .image-grid {
        -moz-column-count: 1;
        -webkit-column-count: 1;
        column-count: 1;
    }
}

.fade-out-500px {
    height: 500px;
    overflow-y: hidden;
    display: block;
    mask-image: linear-gradient(to bottom, 
        rgba(0,0,0,1) 85%, 
        rgba(0,0,0,0.9) 88%, 
        rgba(0,0,0,0.75) 91%, 
        rgba(0,0,0,0.5) 94%, 
        /* rgba(0,0,0,0.04) 97%,  */
        transparent 100%
    );
    /* mask-image: linear-gradient(to bottom, black 85%, transparent 98%); */
    /* mask-image: 
        linear-gradient(to bottom, black 75%, transparent 98%), 
        radial-gradient(circle 140vw at 50% -40vw, black 60%, transparent 65%); */
}
@media (max-width: 600px) {.fade-out-500px { height: 750px; }}


/* Card programming language tags */
.tag-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.tag {
    border-radius: 10rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    display: inline-block;
    border: 1px solid rgba(30, 30, 30, 0.1);
} 
.rust {
    /* background-color: #e08b0b; */
    background-color: #f09206;
    color: #fdfdfd;
} 
.php {
    background-color: #243c8a;
    color: #fdfdfd;
} 
.js {
    background-color: #f1e423;
    color: #373a3d;
}
.cs {
    background-color: #9780e5;
    color: #fdfdfd;
} 

.title-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Code blocks */
.code-block {
    border-radius: var(--border-radius);
    background-color: var(--bg-c-off);
    /* width: fit-content; */
    margin: 2rem 1rem;
}
.code-block > pre {
    padding: 1rem;
    border-radius: var(--border-radius);
    width: fit-content;
    margin: 0;
    width: 100%;
    overflow: auto;
}
.code-block > span {
    padding: 0.5rem;
    display: block;
    text-align: center;
}