@font-face {
    font-family: "Gruppo";
    font-weight: normal;
    src: url(third-party/Gruppo/Gruppo-Regular.ttf);
}
@font-face {
    font-family: "Klee One";
    font-weight: normal;
    src: url(third-party/Klee_One/KleeOne-Regular.ttf);
}

:root {
    --title-font: 'Gruppo';
    --main-font: monospace;
    --cursive-font: 'Klee One';
    /* Colour Theme */
    --bg-1: #112;
    --bg-2: #223;
    --bg-3: #334;
    --fg-1: #eef;
    --fg-2: #ddf;
    --fg-3: #ccf;
    --fg-link: #aaf;
    --emphasis-1: #cca4;
    --emphasis-2: #dda4;
    --emphasis-3: #eea4;
    --shadow-1: #00008088;
    --shadow-2: #ffff0088;
    --ribbon-bg: #331;
    --ribbon-bg-transparent: #111133ee;
    --ribbon-fg: #bbd;
    --description-fg: #112;
}

::-webkit-scrollbar {
    width: 15px;
}
::-webkit-scrollbar-track {
    background: var(--bg-1);
}
::-webkit-scrollbar-thumb {
    border-radius: 7.5px;
    background: var(--fg-1);
}
::selection {
    background: var(--ribbon-bg);
    color: var(--emphasis-2);
    -webkit-text-fill-color: var(--emphasis-2);
    text-shadow: none;
}

* {
    font-family: var(--main-font), monospace;
    transition: all 0.5s;
}
#gradient-text {
    cursor: help; /* ? */
    appearance: none;
    text-decoration: none;
    font-weight: bold;
    font-family: var(--title-font);
    font-size: 250%;

    text-shadow: none;
    --emoji-before: attr(data-emoji-before);
    --emoji-after: attr(data-emoji-after);
    color: var(--emphasis-1);
	background: linear-gradient(135deg, var(--fg-3), 70%, var(--fg-link));
	background-clip: text;
	-webkit-background-clip: text;
	-moz-background-clip: text;
	-webkit-text-fill-color: transparent;
    padding: 2px;
    padding-left: 15px;
    padding-right: 15px;
    transition: all 0.5s;
}

#gradient-text:before {
    content: var(--emoji-before, "👨‍💻");
    padding-right: 10px;
}
#gradient-text:after {
    content: var(--emoji-after, "👩‍💻");
    padding-left: 10px;
}
#gradient-text:after, #gradient-text:before {
    opacity: 0;
    font-size: 1px;
    transition: all 1s;
    font-family: "Segoe UI Emoji";
}
#gradient-text:hover {
    -webkit-text-fill-color: var(--ribbon-bg);
    border-radius: 2px;
    background-clip: border-box;
    -webkit-background-clip: border-box;
	-moz-background-clip: border-box;
    transition: all 0.5s;

}
#gradient-text:hover:after, #gradient-text:hover:before {
    opacity: 1;
    font-size: 0.8em;
    transition: all 0.5s;
}

body {
    text-align: center;
    margin: 0;
    padding: 0;
    overflow-x: hidden;

    background-color: var(--bg-1);
    background: linear-gradient(170deg, transparent 0, transparent 20vh, var(--ribbon-bg) 20vh, var(--ribbon-bg) 70vh, transparent 70vh),
                repeating-linear-gradient(10deg, var(--bg-3) 0vh, var(--bg-3) 50vh, var(--bg-1) 50vh, var(--bg-1) 200vh);
}
main, footer {
    display: inline-block;
    
    width: calc(100% - 100px);
    margin: 50px;
    background-color: var(--bg-2);
    margin-bottom: 20px;
    box-shadow: 0 0 10px var(--bg-1);

    border-radius: 10px;
}
@media (max-width: 540px) {
    main, footer {
        width: 100%!important;
        margin: 0!important;
        border-radius: 0!important;
    }
    .card {
        width: 96%!important;
        margin: 2%!important;
    }
    .card:not(:is(.title, .snippet)) {
        min-height: 59vw!important;
    }

    #modal {
        top: 0%!important;
        left: 0%!important;
        width: 100%!important;
        height: 100%!important;
    }
}
@media (min-width: 540px) {
    main {
        width: 440px;
    }
}
@media (min-width: 980px) {
    main {
        width: 880px;
    }
}
@media (min-width: 1420px) {
    main {
        width: 1320px;
    }
}
.card:not(:is(.title, .snippet)) {
    min-height: 247px;
}
.card {
    width: 400px;
    background-color: var(--bg-3);
    overflow: hidden;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    box-shadow: 2px 2px var(--shadow-1);
    margin: 20px;
    padding: 0;
    float: left;
}
.card.can-be-closed {
    padding-top: 1.5em;
    padding-right: 1em;
    width: calc(400px - 1em);
}
:is(.title, .snippet).can-be-closed {
    width: calc(100% - 40px - 1em)!important;
}
.can-be-closed .close {
    position: absolute;
    top: 0;
    right: 0;
    height: 1em;
    width: 1em;
    padding: 0.25em;
    padding-bottom: 0.5em;
    padding-left: 0.5em;
    border: 0;
    margin: 0;
    font-size: 1.5em;
    text-align: center;
    border-radius: 0;
    border-bottom-left-radius: 1em;
    color: var(--fg-1);
    background-color: var(--bg-1);
    cursor: pointer;
}
.can-be-closed .close:hover {
    background-color: var(--ribbon-bg);
    color: var(--ribbon-fg);
}
.can-be-closed.closed {
    display: none;
}
:is(.title, .snippet) {
    width: calc(100% - 40px);
}
.project .description {
    height: 90%;
    width: 50%;
    padding-right: 50%;
    background: url("images/description-cover.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    left: -80%;
    position: absolute;
    top: 0;
    background-color: transparent;
}
.project .description p {
    margin: 0;
    padding: 3px;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 0;
    width: 50%;
    height: unset;
    transform: translate(0, -50%);
    color: var(--description-fg);
    font-size: 20px;
    text-shadow: 1px 1px var(--emphasis-1);
    text-overflow: ellipsis;
    max-height: 100%;
    overflow: hidden;
}
.card p, .card form {
    margin: auto;
    padding: 3px;
    text-align: center;
    left: 0;
    width: calc(100% - 1em);
    height: 100%;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 0.5em;
    padding-right: 0.5em;
    color: var(--fg-1);
    font-size: 20px;
    text-shadow: 1px 1px var(--emphasis-1);
    text-overflow: ellipsis;
    overflow: hidden;
}
.card p.ribbon, .card form.ribbon {
    background: var(--ribbon-bg);
    border-top: 2px solid var(--ribbon-fg);
    border-bottom: 2px solid var(--ribbon-fg);
    color: var(--ribbon-fg);
    text-shadow: none;
}

.handwriting {
    font-family: var(--cursive-font, cursive);
    font-weight: bold;
}

div.ribbon {
    background: var(--bg-1);
    float: left;
    width: 100%;
    margin: 0;
    padding: 0;
}

#searchbar {
    background: var(--bg-2);
    color: var(--fg-1);
    font-size: 1em;
    text-align: center;
    border: 2px solid var(--ribbon-fg);
    border-radius: 2px;
    box-shadow: inset 2px 2px var(--shadow-1);
}
#searchbar:focus {
    outline: none;
    box-shadow: inset 5px 5px var(--shadow-2);
}

.title, .snippet {
    min-height: unset!important;
}
.project .title, .project .snippet {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 10%;
    width: 100%;
    background-color: var(--ribbon-bg-transparent);
    font-family: var(--title-font);
    font-size: 20px;
    font-weight: bold;
    color: var(--ribbon-fg);
    text-align: center;
    text-overflow: ellipsis;
    text-shadow: 0 0 transparent;
}

.project:hover .description {
    left: 0;
    background-color: var(--fg-1);
}
.project:hover :is(.title, .snippet) {
    text-decoration: underline;
    color: var(--emphasis-2);
    background: var(--ribbon-bg);
}
.project:hover {
    box-shadow: 5px 5px var(--shadow-2);
    cursor: pointer;
}

.card:hover {
    box-shadow: 0 0 25px var(--shadow-1);
}
/*Modal*/
#modal {
    position: fixed;
    top: 5%;
    left: 5%;
    height: 90%;
    width: 90%;
    --custom-bg: var(--bg-1);
    --custom-bg-2: var(--bg-2);
    --custom-shadow: var(--shadow-1);
    --custom-fg: var(--fg-1);
    --custom-fg-3: var(--fg-3);
    --custom-emphasis-1: var(--emphasis-1);
    --custom-emphasis-2: var(--emphasis-2);
    --custom-emphasis-3: var(--emphasis-3);
    background-color: var(--custom-bg);
    box-shadow: 5px 5px var(--custom-shadow);
    z-index: 2;
    color: var(--custom-fg);

    margin: 0;
    border: 0;
    padding: 0;
    overflow: hidden;

    outline: max(5vh, 5vw) solid #00000088;
}
#modal h1 {
    height: 36px;
    font-size: 30px;
    padding: 2px;
    margin: 0;
    text-align: center;
    width: calc(100% - 50px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    float: left;
    border-bottom: 1px solid var(--custom-fg);
    font-family: var(--title-font);
}
#modal .close {
    text-decoration: none;
    background-color: var(--custom-bg);
    color: var(--custom-fg);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid transparent;
    padding: 2px;
    margin: 3px;
    text-align: center;
    vertical-align: middle;
    font-size: 20px;
    float: right;
    cursor: pointer;
}
#modal .close:hover {
    border: 1px solid var(--custom-fg);
    background-color: var(--custom-fg);
    color: var(--custom-bg);
}
#modal .contents {
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--custom-fg);
    height: 100%;
    overflow: auto;
}
#modal .column-l {
    width: 53%;
    margin: 0;
    padding: 2%;
    border-right: 1px solid var(--custom-fg);
    float: left;
    text-align: left;
}
#modal .column-r {
    width: 33%;
    margin: 0;
    padding: 2%;
    float: right;
    text-align: left;
}
@media (max-width: 500px) {
    #modal .column-l, #modal .column-r {
        width: 96%;
        margin: 0;
        padding: 2%;
        border-bottom: 1px solid var(--custom-fg);
        border-right: 0;
        float: left;
        text-align: left;
    }
}
#modal .column-l img {
    width: 100%;
}
#modal .column-l iframe {
    width: 100%!important;
}
#modal[open] {
    display: block;
    opacity: 1;
    pointer-events: all;
}
#modal button {
    background-color: var(--custom-bg-2);
    border: 1px solid var(--custom-fg-3);
    color: var(--custom-fg);
    padding: 0.5em;
}
#modal button:hover {
    background-color: var(--custom-emphasis-2);
    border: 1px solid var(--custom-emphasis-3);
    color: var(--fg-2);
}
.icon {
    height: 2em;
    margin: 0.5em;
}
p:hover .social img {
    filter: saturate(0.0);
    opacity: 0.5;
}
p:hover .badge img {
    filter: saturate(0.5);
    opacity: 0.5;
}
a.social img {
    padding: 2px;
    filter: saturate(1.0);
    transition: filter 0.5, transform 1.0;
    border: 2px solid transparent;
}
.badge img {
    border-radius: 10px;
    border: 2px solid #aaa;
    border-bottom: 2px solid #444;
    border-right: 2px solid #777;
    border-left: 2px solid #999;
    border-top: 2px solid #aaa;
    max-width: 100%;
}
.badge:hover img {
    box-shadow: 0 0 15px #444;
    filter: none!important;
    opacity: 1!important;
}
a.social:hover img {
    filter: none!important;
    opacity: 1!important;
    transform: rotate(360deg)!important;
    background-color: var(--emphasis-2);
    border-radius: 50%;
    border: 2px solid var(--emphasis-3);
}
a.social:active img {
    filter: none!important;
    opacity: 1!important;
    transform: rotate(360deg)!important;
    background-color: var(--emphasis-2);
    border-radius: 50%;
    border: 2px solid var(--emphasis-1);
}
#modal button .icon {
    height: 2em;
    margin-top: 0;
    margin-bottom: 0;
}
.description .logo {
    position: absolute;
    right: 10px;
    bottom: 5px;
    height: 30px;
    width: 30px;
}
a {
    color: var(--fg-link);
    text-shadow: 1px 2px var(--emphasis-1);
}

a:hover {
    text-shadow: -1px 2px var(--emphasis-2);
}

/* Animations */
.card:not(#searchresults .card) {
    animation-name: floatin;
    animation-duration: 2s;
    animation-iteration-count: 1;
}
.card:is(.title, .snippet):nth-of-type(1) {
    animation-delay: -2s;
}
.card:is(.title, .snippet) {
    animation-delay: -1s;
}
@media (min-width: 1320px) {
    a:nth-of-type(1) .card.project {
        animation-delay: -0.25s;
    }
    a:nth-of-type(2) .card.project {
        animation-delay: -0.5s;
    }
    a:nth-of-type(3) .card.project {
        animation-delay: -0.75s;
    }
    /* 3 wide */
}
@media (min-width: 880px) and (max-width: 1320px) {
    a:nth-of-type(1) .card.project {
        animation-delay: -0.33s;
    }
    a:nth-of-type(2) .card.project {
        animation-delay: -0.67s;
    }
    /* 2 wide */
}
@keyframes floatin {
    from, 50% {
        opacity: 0;
        transform: translateX(-100vw);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
