@font-face {
    font-family: 'Terminal grotesque';
    font-weight: 400;
    font-style: normal;
    src: url(components/blink/terminal-grotesque.ttf) format('truetype');
}
@font-face {
    font-family: 'Atkinson';
    font-weight: 400;
    font-style: normal;
    src: url(AtkinsonHyperlegibleMono-VariableFont_wght.ttf) format('truetype');
}
:root {
    --crt-shadow: 2px 0 1px aquamarine, -2px -1px 1px hotpink;
}

body {
    display: flex;
    flex-direction: column;
    min-block-size: 100vh;
    font-size: 16px;
    font-family: 'Atkinson', 'Terminal grotesque', sans-serif;
    margin: 0;
    background: #bcbec3 linear-gradient(transparent, #989ba2);
    color: #161c15;
}
main {
    display: grid;
    grid-template-rows: auto 1fr;
    flex: 1;
    --stripe: rgb(209, 202, 148);
    background-image: linear-gradient(-45deg, 
        var(--stripe) 10%, transparent 10%, 
        transparent 40%, var(--stripe) 40%, 
        var(--stripe) 60%, transparent 60%, 
        transparent 90%, var(--stripe) 90%);
  background-repeat: repeat;
  background-size: 10px 10px;
}

header {
    font-size: 1.5rem;
    block-size: auto;
    color: greenyellow;
    text-shadow: var(--crt-shadow), 0 0 .4ch #f1ff85cc;
    background-color: #161c15; 
    padding: .5em 0;
    hgroup {
        display: flex;
        white-space: nowrap;
        align-items: center;
        gap: 1em;
        overflow: auto;
        text-transform: uppercase;
    }
}
h1 {
    font-weight: normal;
    letter-spacing: 0.15ch;
}
h1, h2, p {
    font-size: 1em;
    margin: 0;
}
h1, h2, p, a {
    text-shadow: var(--crt-shadow);
}

p {
    line-height: 1.3;
}
random-ui {
    display: inline-block;
    margin: auto 3rem;
    --rotate: var(--random-ui, 75);
    transform: rotateZ(calc(var(--rotate) * 0.01deg));
}
section {
    font-size: 1.5rem;
    background-color: #e2e0d1;
    max-inline-size: 33ch;
    inline-size: calc(100% - 6rem);
    box-sizing: border-box;
    padding: 1px;
    border: 2px outset #fff;

    .title-bar {
        background-color: #646040;
        color: #fff;
        display: flex;
        flex-flow: row wrap;
        justify-content: space-between;
        align-items: center;
        padding-block: .75rem;
    }

    > * {
        padding-inline: 1.25rem;
        margin-block-end: 1.25rem;

    }
}

.new-scroller {
    overflow: hidden;
    container-type: inline-size;
    flex: auto;

    content-repeater {
        --copy-gap: 2em;
        --approx-nbr-of-ems-per-second: 4;
        --content-width-in-ems: 100;
        --percent-of-viewport-per-second: calc(var(--content-width-in-ems) / var(--approx-nbr-of-ems-per-second));
        display: flex;
        inline-size: fit-content;
        min-inline-size: 200%;
        animation: new-scroller-animation linear infinite;
        animation-duration: calc(var(--percent-of-viewport-per-second) * 1000ms); 

        &>* {
            margin-inline: 0 auto;
            padding-inline-end: var(--copy-gap);
        }

        &:hover {
            animation-play-state: paused;
        }

    }
}
.new-scroller--reverse {
    & content-repeater {
        animation-direction: reverse;
        --copy-gap: .5em;
    }
}
.weiter {
    display: flex;
    gap: .5em;
}
@keyframes new-scroller-animation {
    0% { 
        transform: translateX(0); }
    100% { 
        transform: translateX(-50%); }
}


web-opticon {
    font-size: 3rem;
    --wo-eye-color-pupil: #161c15;
    --wo-eye-color-iris: rgb(209, 202, 148);
    --wo-eye-color-body: #fbf3e2;
    --wo-eye-color-lids: #575757;
    animation: eye-blink 6000ms infinite;
}

@keyframes eye-blink {
    0%, 94% {
        --wo-eye-color-iris: rgb(209, 202, 148);
        --wo-eye-color-pupil: #161c15;
        --wo-eye-color-body: #fbf3e2;

    }
    95% {
        --wo-eye-color-iris: var(--wo-eye-color-lids);
        --wo-eye-color-pupil: var(--wo-eye-color-lids);
        --wo-eye-color-body: var(--wo-eye-color-lids);

    }
}

footer {
    font-size: 1.5rem;
    background-color: #161c15;
    padding: 3rem;

    a {
        color: greenyellow;
    }
}

.badges {
    font-size: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-block-start: 4em;
}

.badge {
    --height-in-percent: 100;

    --color-background: white;
    --color-foreground: black;
    animation: flash 1000ms steps(1) infinite;
    background: var(--color-background);
    color: var(--color-foreground);
    border-top: .075em solid #fff6;
    border-left: .075em solid #fff6;
    border-right: .075em solid #0006;            
    border-bottom: .075em solid #0006;
    font-size: 2em;
    padding: .075em;
    block-size: 1em;
    aspect-ratio: 2.8387096774;
    box-sizing: border-box;

    text {
        fill: currentColor;
        font-size: calc(1em*var(--height-in-percent)/100);
        /* 
        font-size decides row height in svg - since width is stretched to a 100%
        y - position as text-attribute is arbitrary number, origin seems to be bottom or baseline of text
        */
    }

    &:hover {
        animation-play-state: paused;
    }
}
.badge--1 {
    --color-background: hotpink;
    --color-foreground: gold;
    text-shadow: 1px 1px #000;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: bold;
    text-transform: uppercase;
}
.badge--2 {
    --color-background: firebrick;
    --color-foreground: wheat;
    animation-timing-function: ease;
    text-shadow: 1px 1px #000;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-style: italic;
    font-weight: bold;
    text-transform: uppercase;
}
.badge--3 {
    --color-background: greenyellow;
    --color-foreground: rebeccapurple;
    animation-duration: 666ms;

    text-shadow: 1px 1px #ff0;
    font-family: sans-serif;
    font-weight: normal;
    text-transform: uppercase;
}
.badge--4 {
    --color-background: white;
    --color-foreground: black;
    font-family: monospace;
    font-weight: normal;
    text-transform: uppercase;
}

@keyframes flash {
    0% {
        color: var(--color-foreground);
        background: var(--color-background);
    }
    50% {
        color: var(--color-background);
        background: var(--color-foreground);
    }
}
@media (prefers-reduced-motion: reduce) {
    .new-scroller content-repeater,
    .badge,
    web-opticon {
        animation: none;
    }
}