/* noto serif, serif typeface*/
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif&display=swap');
/* roboto, sans serif typeface*/
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* light mode palette, old: #f8f8f8 */
    --grey: #fdfdef;
    /*#0d2518*/
    --dark-green: #1f3832;
    --red: #c25c5f;
    /* TODO: decide if visited links need another color */
    --dark-red: #c25c5f;
    /* dark mode palette */
    --dm-grey: #c8b9b9;
    --dm-dark-green: #12231e;
    --dm-darker-green: #0e1917;



    --color-accent: var(--red);
    --color-accent-dark: var(--dark-red);
    --color-button: var(--red);


    & body[data-color-scheme=""],
    & body[data-color-scheme="light"] {
        --color-primary: var(--dark-green);
        --color-secondary: var(--grey);
        --color-portrait-background: var(--dark-green);
        --color-footer-bg: var(--dm-darker-green);
        --color-footer-text: var(--color-secondary);
        --color-color-mode-icon: var(--dark-green);
    }

    & body[data-color-scheme="dark"] {
        --color-primary: var(--dm-grey);
        --color-secondary: var(--dm-dark-green);
        --color-portrait-background: var(--dm-grey);
        --color-footer-bg: var(--dm-darker-green);
        --color-footer-text: var(--color-primary);
        --color-color-mode-icon: var(--dm-grey);
    }

    /*2.986rem*/
    --font-size-h1: 2.906rem;
    /*2.328*/
    --font-size-h2: 2.128rem;
    --font-size-h3: 2.074rem;
    /*
    --font-size-h4: 1.728rem;
    --font-size-h5: 1.44rem;
    --font-size-h6: 1.2rem;
    */
    --font-size-a: 1rem;
    --font-size-button: 1.2rem;

    /*1rem*/
    --font-size-p: 1.44rem;
    /*0.833rem*/
    --font-size-small: 0.833rem;
    /*0.694rem*/
    --font-size-very-small: 0.694rem;

}

body {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    margin-inline: auto;
    width: fit-content;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: color .1s ease-in-out, background-color .1s ease-in-out;

}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
    margin-bottom: 28px;
}

h3 {
    font-size: var(--font-size-h3);
    margin-top: 26px;
    margin-bottom: 10px;
}

p {
    font-size: var(--font-size-p);
    margin-bottom: 10px;
}

a {
    font-size: var(--font-size-a);
}

::selection {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

button {
    font-size: var(--font-size-button);
    cursor: pointer;
}

.button--standard {
    padding: 8px 8px;
    background-color: var(--color-button);
    color: var(--color-secondary);
    border: none;
    /*old value: 5px*/
    border-radius: 0px;
}

.button--icon {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    opacity: .5;
    transition: opacity .1s linear;
}

.button--icon:hover {
    opacity: 1;
}

small {
    font-size: var(--font-size-small);
}

h1,
h2,
h3,
a {
    font-family: "Noto Serif", serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    font-variation-settings:
        "wdth" 100;
}

p,
span,
li {
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings:
        "wdth" 100;
}

a {
    color: var(--color-accent);
    font-weight: bold;
}

a:visited {
    color: var(--color-accent-dark);
}

section {
    flex: auto;
    /*margin-bottom was 50px previously*/
    margin-bottom: 36px;
}

section:first-of-type,
footer {
    flex: 1;
}

section,
main,
footer {
    padding-inline: 10px;
}

#hero {
    position: relative;
    /* old value 20px */
    margin-top: 8px;
}

#page-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#page-controls-lang {}

#page-controls-lang>* {
    padding: 4px;
}

#color-mode-button {}

#color-mode-button-light,
#color-mode-button-dark {}

body[data-color-scheme="dark"] #color-mode-button-light {
    display: none;
}

body[data-color-scheme=""] #color-mode-button-dark,
body[data-color-scheme="light"] #color-mode-button-dark {
    display: none;
}

#hero>h1,
#hero>h2 {
    text-align: center;
}

#hero>h1 {
    transition: text-shadow .4s ease-in-out 1s;
}

#hero-btn {
    width: fit-content;
    align-self: center;
}

/**/
.backbround__ascii__wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    z-index: -10;
    pointer-events: none;
    transform-origin: top left;
    white-space: pre;
    box-sizing: border-box;
}

.backbround__ascii {
    position: absolute;
    transform-origin: top left;

    display: block;
    unicode-bidi: isolate;
    margin: 0;
    padding: 0;
    white-space: pre;
    pointer-events: none;
    user-select: none;
    /*font-family: 'Courier New', Courier, monospace;*/
    font-family: monospace;

}

.ascii__HW {
    line-height: 3.5px;
    inset: 0;
    font-size: 3.5px;
    /*12px*/

    transform: translateX(-50%);
}

@media screen and (width >=500px) {
    .ascii__HW {
        transform: translateX(0);
    }
}

body[data-color-scheme="dark"] .backbround__ascii {
    opacity: 0.2;

    &.ascii__HW {
        opacity: 0.4;
    }
}


body[data-color-scheme="light"] .backbround__ascii,
body[data-color-scheme=""] .backbround__ascii {
    opacity: 0.2;

    &.ascii__HW {
        opacity: 0.5;
    }
}

.name--observed {
    text-shadow: 2px 3px 0 var(--color-secondary);
    transition: text-shadow 200ms linear 500ms;
}

.name--observed.show {
    text-shadow: 2px 3px 0 var(--color-accent);
}

.project__demo__wrapper {
    position: relative;
    width: 100%;
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    padding: 0;
}

.project__demo__gif {
    width: 100%;
    object-fit: cover;
}

.projectpage__anchor {
    display: block;
    font-size: var(--font-size-p);
}

ul {
    list-style: none;
}

ul:not(:has(.card__item))>li {
    border-left: 3px solid var(--color-primary);
    padding-left: 6px;
    margin-bottom: 8px;
    font-size: var(--font-size-button);
}


ul:has(.card__item) {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-wrap: wrap;
}

.card__item {
    background-color: var(--color-secondary);
    font-size: var(--font-size-a);
    padding: 4px 7px;
    border: 2px solid var(--color-primary);
    border-radius: 20px;
    width: fit-content;
    cursor: default;
}

/**/

footer {
    position: relative;
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
}

#footer-top {
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#footer-top>div {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

#footer-top>div>div>a {
    padding: 4px;
}

#footer-top>button {
    height: fit-content;
}

footer>p {
    text-align: center;
    font-size: var(--font-size-small);
}


#back__to__top__button {
    width: 40px;
    height: 40px;
}

#footer__c {
    opacity: .2;
    transition: opacity 100ms ease-in-out;
    margin-bottom: 0;
}

#footer__c:hover {
    opacity: .5;
}

body[data-color-scheme="dark"] {
    & .project__card::after {
        background-image: url("data:image/svg+xml,<svg id='patternId' width='100%' height='100%' xmlns='http://www.w3.org/2000/svg'><defs><pattern id='a' patternUnits='userSpaceOnUse' width='10' height='10' patternTransform='scale(1.8) rotate(0)'><rect x='0' y='0' width='100%' height='100%' fill='%2311221800'/><path d='M 10,-2.55e-7 V 20 Z M -1.1677362e-8,10 H 20 Z'  stroke-width='0.5' stroke='%23c2c2c2ff' fill='none'/></pattern></defs><rect width='800%' height='800%' transform='translate(0,0)' fill='url(%23a)'/></svg>");
    }
}

@media screen and (width >=500px) {

    #hero,
    main {
        max-width: 800px;
        justify-self: center;
    }

    #hero>h1,
    #hero>h2 {
        text-align: left;
    }

    #about__body {
        /*rethink this flex direction*/
        /*flex-direction: row;*/
    }

    #about__body>* {
        flex: 1;
    }

    .project__demo__wrapper {
        width: 86%;
    }

}

@media screen and (width>=700px) {
    section {
        margin-bottom: 40px;
    }

    #about-flex-temp {
        display: flex;
        flex-direction: row-reverse;
        gap: 3rem;
    }

    #about-image-wrapper {
        flex: none;
    }

    .project__demo__wrapper {
        width: 66%;
    }
}

@media screen and (width >=1200px) {
    body {
        max-width: 1200px;
    }
}