/* Font-face declarations */

@font-face {
    font-family: 'GASBOA';
    src: url(Fonts/GASBOA__.woff2) format('woff2'); /* ATTR: GASBOOK 2;MACHINE */
}
.GASBOA { font-family: 'GASBOA'; }

@font-face {
    font-family: 'PSEUDO';
    src: url('Fonts/PAPL_.woff') format('woff');
    font-weight: normal;
}
.PSEUDO { font-family: 'PSEUDO'; }

@font-face {
    font-family: 'ZEN';
    src: url(Fonts/ZenAntique-Regular.woff) format('woff');
}
.ZEN { font-family: 'ZEN'; }

@font-face {
    font-family: 'REP';
    src: url(Fonts/REPUBI__.ttf) format('truetype');
}
.REP { font-family: 'REP'; }

/* Root variables for colors */

:root {
	--notblack: #111111; 
	--midGrey: #808080;
	--darkGrey: #252525;
	--notwhite: #f3f3f3;
	--contrast: #ff0000;
    font-size: 1.6vh;
}

html {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    /* filter: url('#chromatic-aberration'); */
}
body {
    width: 100vw;
    height: 100vh;
    height: 100svh;
    position: fixed;
    cursor: crosshair;
    user-select: none;
    overflow: hidden;
    background: radial-gradient(circle, var(--notblack) 0%, var(--darkGrey) 100%), var(--notblack);
}

html, body, #wrapper, .flex {
    display: flex;
    justify-content: center;
    align-items: center;
}

h1, h2, p { 
    margin: 0;
    font-family: 'PSEUDO', 'Courier New', 'Monospace', 'Lucida Console', Courier, monospace; 
}

.header {
    position: absolute;
    width: fit-content;
    height: fit-content;
    writing-mode: tb-rl;
    line-height: 0;
    font-size: 6vh;
    font-family: 'GASBOA';
    z-index: 0;
    color: var(--notwhite);
    text-shadow: 0.3vh -0.6vh var(--contrast);
    &:nth-child(1) { left: 5vh; }
    &:nth-child(2) { 
        right: 5vh; 
        transform: rotate(180deg); 
    }
    &:nth-child(3) { 
        animation: marquee 60s linear infinite;
        font-size: 30vh;
        left: 15%;
        z-index: -1;
        color: transparent;
        text-shadow: none;
        -webkit-text-stroke-width: 0.3vh;
        -webkit-text-stroke-color: var(--contrast);
        height: 100vh;
        height: 100svh;
    }
}

#viewport {
    position: absolute;
    width: calc(100% - 24vh);
    max-width: 80vh;
    margin: 11vh;
    height: 86vh;
    z-index: 1;
    & > p { 
        position: absolute;
        color: var(--contrast);
    }
    & > p:nth-child(1) {
        text-align: right;
        right: 0;
        bottom: -1vh;
    }
    & > p:nth-child(2) {
        bottom: 0.7vh;
        text-transform: uppercase;
    }
    & > p:nth-child(3) {
        top: 25vh;
        right: -1vh;
        font-family: 'ZEN';
        writing-mode: vertical-rl;
        font-size: 2vh;
        transform: scaleY(200%);
        color: var(--notblack);
        background: var(--notwhite);
    }
}

#clock::after { content: 'Z'; }

iframe[name="modal"]:not(:target) {
    width: 600px; /* Set your desired width */
    height: 400px; /* Set your desired height */
    border: 1px solid #ccc;
}

#modal:not(:target) {
    display: none;
}

.colors, .filter {
    cursor: pointer;
}

.html-filtered {
    filter: url('#chromatic-aberration');
}

#glass {
    position: absolute;
    width: calc(100% - 24vh);
    max-width: 80vh;
    margin: 11vh;
    height: 80vh;
    box-sizing: border-box;
    backdrop-filter: blur(1vh);
    /* https://css-tip.com/corner-only-border-image/ */
        --s: 5vh; /* the size on the corner */
        --t: 0.5vh;  /* the thickness of the border */        
        padding: var(--t);
        outline: var(--t) solid var(--contrast); /* the color here */
        outline-offset: calc(-1*var(--t));
        mask:
            conic-gradient(at var(--s) var(--s),#0000 75%,#000 0)
            0 0/calc(100% - var(--s)) calc(100% - var(--s)),
            linear-gradient(#000 0 0) content-box;
    &::after{
        content: '';
        position: absolute;
        width: calc(100% - 1vh);
        height: calc(100% - 1vh);
        background-color: var(--contrast);
        opacity: 10%;
    }
}

#content {
    position: absolute;
    inset: 5vh 2.3vh 5vh 2.3vh;
    box-sizing: border-box;
    color: var(--notwhite);
    & h1 {
        margin: 0 0 0 0;
        font-family: 'REP';
        font-size: 7vh;
        text-align: center;
        text-shadow: 0 0.2vh var(--contrast);
    }
    & h2 {
        margin-left: 0;
        font-family: 'ZEN';
        font-size: 3vh;
        text-align: left;
        text-shadow: 0 0.2vh var(--contrast);
    }
    & p {
        display: inline;
        color: var(--notblack);
        background: var(--notwhite);
    }
}

#perspective {
    perspective: 50vh;
    perspective-origin: center center;
    width: 0;
    height: 0;
    position: absolute;
    z-index: -5;
    *, *:before, *:after {
        transform-style: preserve-3d;
        transform-origin: center center;
    }
}

#wrapper {
    --size3d: 50vh;
    transform: rotateX(90deg) rotateY(-45deg);
    position: absolute;
    width: var(--size3d);
    height: var(--size3d);
    top: calc(var(--size3d)/-2);
    left: calc(var(--size3d)/-2);
    animation: slow-rotate 20s linear infinite;
    /* background: blue; */
}

.circle {
    position: absolute;
    border-radius: 50%;
    &:nth-child(1), &:nth-child(2), &:nth-child(5), &:nth-child(6) {
        width: 50vh;
        height: 50vh;
        border-width: 10vh;
        border-style: solid;
    }
    &:nth-child(1) {
        border-color: var(--darkGrey);
        filter: blur(1vh);
        transform: translateZ(-40vh);
    }
    &:nth-child(2) {
        border-color: var(--notblack);
        filter: blur(0.1vh);
        transform: translateZ(-30vh);
    }
    &:nth-child(3), &:nth-child(4) {
        color: var(--contrast);
        transform: translateZ(-30vh);
    }
    &:nth-child(4) { transform: rotateZ(45deg) translateZ(-30vh); }
    &:nth-child(5) {
        border-color: var(--contrast);
        filter: blur(0.1vh);
        transform: translateZ(30vh);
    }
    &:nth-child(6) {
        border-color: var(--notblack);
        filter: blur(1vh);
        transform: translateZ(40vh);
    }
}

.trigrams p {
	--trigram-distance: 30vh;
    font-size: 6vh;
    font-weight: 600;
    position: absolute;

	&:nth-child(1){ transform: translate( 0, calc( 0vh - var(--trigram-distance) ) );  }
	&:nth-child(2){ transform: translate( var(--trigram-distance) , 0) rotate(90deg);  }
	&:nth-child(3){ transform: translate( 0, var(--trigram-distance) ) rotate(180deg); }
	&:nth-child(4){ transform: translate( calc( 0vh - var(--trigram-distance) ), 0) rotate(270deg); }
		/* listen, this was the best I could do without using a preprocessor like sass */
}

.diamond {
    position: absolute;
    border: 0.5vh solid var(--midGrey);
    border-radius: 2vh;
    width: 66vh;
    height: 66vh;
    &:nth-child(4) {
        transform: translateZ(5vh);
    }
    &:nth-child(5) {
        transform: rotateZ(45deg) translateZ(10vh);
    }
}

@keyframes slow-rotate {
    0% { transform: rotateX(90deg) rotateY(-45deg) rotateZ(0deg); }
    100% { transform: rotateX(90deg) rotateY(-45deg) rotateZ(360deg); }
}

@keyframes marquee { 0% { transform: translateY(100vh); } 100% { transform: translateY(-500vh); } }

@-moz-document url-prefix() {    
    .header{
        text-shadow: 0.6vh 0.2vh var(--contrast);
        &:nth-child(2) { 
            left: 100vh; /* WHY does this work??? (as opposed to right: 5vh) Fuckin Firefox... */
        }
    }
}

@media (hover: none) and (pointer: coarse) {
    .header { 
        &:nth-child(2) { display: none; } 
    }

    #viewport {
        margin: 0;
        top: 2vh;
        left: 11vh;
        width: calc(100% - 14vh);
        height: calc(100% - 6vh);
    }

    #clock { 
        display: none; 
    }

    #glass {
        margin: 0;
        top: 4.5vh;
        left: 11vh;
        width: calc(100% - 14vh);
        height: calc(100% - 11.8vh);
    }

    #content h1 {
        font-size: 5vh;
    }

    .header {
        &:nth-child(3) {
            left: 15%;
        }
    }

    @-moz-document url-prefix() {
        .circle:nth-child(n) { 
            filter: blur(0px); 
        }
    }
}