@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Xanh+Mono:ital@0;1&display=swap'); /* tells the CSS engine to include an external stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* CSS RESET */

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

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
}

textarea {
  overflow: auto;
  resize: none;
}

/* ------------------------------------------------- */

/* CONSTANTS */
:root {
    /* light mode colors */
    --LIGHT-ACCENT-COLOR: #e25aab;
    --LIGHT-BGCOLOR: #fbf9fa;
    --LIGHT-PRIMARY-COLOR: #b24e89;
    --LIGHT-SECONDARY-COLOR: #e29bc5;
    --LIGHT-TEXT-COLOR: #100D0F;
    --LIGHT-FORM-COLOR: #fbf9fa;
    --LIGHT-CONTENTBG: #EDEDED;
    --LIGHT-BORDER-COLOR: #100D0F;

    /* dark mode colors */
    --DARK-ACCENT-COLOR: #a51d6e;
    --DARK-BGCOLOR: #060405;
    --DARK-PRIMARY-COLOR: #b14e88;
    --DARK-SECONDARY-COLOR: #631d46;
    --DARK-TEXT-COLOR: #f1eef0;
    --DARK-CONTENTBG: #4b4a4a;
    --DARK-BORDER-COLOR: #EDEDED;

    /* margin defaults */
    --TOP-MARGIN: 5%;
    --SIDE-MARGIN: 5%;

    /* border */
    --BORDER: 1px solid var(--LIGHT-BORDER-COLOR);

    /* fonts */
    --BODY-FONT: "Noto Serif", serif;
    --HEADINGS-FONT: "Xanh Mono", monospace;
    --SPECIAL-FONT-A: "Inter", sans-serif;
    --SPECIAL-FONT-B: "Courier Prime", monospace;
    --FONT-WEIGHT: 300;
    --BODY-FONT-SIZE: 1.2rem;
    --ASIDE-BODY-FONT-SIZE: 1rem;
    --TITLE-FONT: var(--FONT-WEIGHT) 3rem var(--HEADINGS-FONT);
    --NAV-FONT: var(--FONT-WEIGHT) 2rem var(--BODY-FONT);
    --NAV-FONT-MOBILE: var(--FONT-WEIGHT) 1.5rem var(--BODY-FONT);
    --HEADER-FONT: var(--FONT-WEIGHT) 5rem var(--HEADINGS-FONT);
    --NORMAL-FONT: var(--FONT-WEIGHT) var(--BODY-FONT-SIZE) var(--BODY-FONT);

    /* others */
    --SM-AUD-SIZE-WEB: 7rem;
    --LG-AUD-SIZE-WEB: 8.5rem;

}

/* ------------------------------------------------- */

/* UTILITY CLASSES */
.highlight {
    color: var(--LIGHT-PRIMARY-COLOR);
}

/* ------------------------------------------------- */


/* LIGHT MODE */

/* General Style */

html {
    scroll-behavior: smooth;
}


@keyframes appear {
    from {
        scale: .9;
        opacity: 0;
    }

    to {
        scale: 1;
        opacity: 1;
    }
}


body {
    background-color: var(--LIGHT-BGCOLOR);
    min-height: 100vh;

    animation: appear;
    animation-duration: 1s;
}


/* Components/Blocks */

/* class-based */


.body--contact {
    padding: 5%;
    display: grid;
    grid-template-areas:
        'hd hd mn mn mn'
        'ft ft ft ft ft';
    gap: 1rem;
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        transform: translateY(30vh) rotateX(20deg);
        opacity: 0;
    }
    
}

.header {
    margin: var(--TOP-MARGIN) var(--SIDE-MARGIN) -8%; /* T, R&L, B*/
    display: flex;
    justify-content: space-between;
    align-items: start;
    overflow: hidden;

    animation: fade-out linear;
    animation-timeline: view();
    animation-range: exit;
}

.header__logo {
    width: 18%;
    min-width: 80px;
    height: auto;
    border-radius: 50%;
    object-fit: contain;
}

.header__title {
    padding-top: 2rem;
    font: var(--HEADER-FONT); 
}

.header__nav {
    width: 18%;
    min-width: 100px;
    text-align: right;
}

.header__nav--cat {
    text-align: left;
}

:is(.header__nav__title, .header__nav__toggle, .header__nav__mask,
    .footer__nav__title, .footer__nav__toggle, .footer__nav__mask) {
    display: none;
}

.header__nav__ul, .header__nav__ul--cat {
    list-style: none;
    line-height: 4rem;
}

.header__nav__ul_li a:any-link  {
    display: inline-block;
    color: var(--LIGHT-TEXT-COLOR);
    font: var(--NAV-FONT);
    text-decoration: none;
}

.header__nav__ul_li a:is(:hover, :focus) {
    color: var(--LIGHT-PRIMARY-COLOR);
    transform: translate(-1.5rem) scale(120%);
    transition: transform 1s ease-in-out;
}

.header__nav__ul_li--cat a:is(:hover, :focus) {
    transform: translate(1.5rem) scale(120%);
}

.header--contact {
    grid-area: hd;
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: center;
}

.header--contact__title {
    font: var(--HEADER-FONT);
    padding-bottom: 1rem;
}

.header--contact__copy {
    font: var(--FONT-WEIGHT) 2rem var(--HEADINGS-FONT);
    padding-bottom: 1rem;
}

.header--contact__nav {
    display: none;
}

.main {
    margin: 0 var(--SIDE-MARGIN) 0; /* T, R&L, B*/
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes fade-in {
    from {
        scale: .8; 
        opacity: 0;
    }

    to {
        scale: 1;
        opacity: 1;
    }
}

.main__article {
    width: 60%;
    margin: 1.5rem 0;
    background-color: var(--LIGHT-CONTENTBG);
    border: var(--BORDER);
    animation: fade-in linear;
    animation-timeline: view();
    animation-range: entry;
}

.main__article__title {
    padding: 1.5rem;
    border-bottom: var(--BORDER);
    color: var(--LIGHT-PRIMARY-COLOR);
    font: var(--TITLE-FONT); 
}

.main__article__text {
    padding: 1.5rem;
    color: var(--LIGHT-TEXT-COLOR);
    font: var(--NORMAL-FONT);
    white-space: pre;
    line-height: 2.5rem;
}

/* TODO checkout other way for serving audio and styling */
.main__article__audio {
    width: 100%;
    padding: 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 1rem;

    > p {
        color: var(--LIGHT-TEXT-COLOR);
        font: var(--NORMAL-FONT);
        white-space: pre;
        line-height: 2.5rem;
    }
}

.main__article__audio__player {
    width: 100%;
    padding: 0 10% 0 5%;
    background-color: var(--LIGHT-PRIMARY-COLOR);
    border-radius: 50px;
    min-height: var(--LG-AUD-SIZE-WEB);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 2rem;


    > .control {
        flex: 1;
        border-radius: 50px;
        border: none;
        max-width: 80px;
        aspect-ratio: 1 / 1;
        font: var(--FONT-WEIGHT) 2rem var(--BODY-FONT);
        color: var(--LIGHT-PRIMARY-COLOR);
        background-color: var(--LIGHT-BGCOLOR);   

    }

    > .screen {
        flex: 4;
        min-height: var(--LG-AUD-SIZE-WEB);
        border-radius: 50px;
        background-color: var(--LIGHT-SECONDARY-COLOR);
        display: flex;
        flex-flow: column nowrap;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.5rem 0;

               

        > p {
            flex: 1;
            font: 700 1.15rem var(--SPECIAL-FONT-A);
            color: var(--LIGHT-FORM-COLOR);

        }

        > .screen__details {
            border: 0.2px solid var(--LIGHT-BGCOLOR);
            width: 80%;
            flex: 4;
            background-color: #D9D9D9;
            font: var(--FONT-WEIGHT) 1.15rem var(--SPECIAL-FONT-B);
            color: var(--LIGHT-TEXT-COLOR);
            display: flex;
            flex-direction: column;
            align-items: left;
            justify-content: center;
            
            > .progress-container {
                margin-left: 5%;
                width: 90%;
                height: 10px;
                border: 0.2px solid black;

                > .progress-bar {
                    width: 0%;
                    height: 100%;
                    background-color: var(--LIGHT-ACCENT-COLOR);

                }

            }
            
        }


    }
}


.main__article__fig {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 1rem;
    color: var(--LIGHT-TEXT-COLOR);
    font: var(--NORMAL-FONT);
    text-align: left;
    line-height: 2.5rem;
}

.main__page-nav {
    padding: 10rem 0;
    min-width: 100%;
    display: grid;
    grid-template-areas: 
        'next next'
        'prev prev'
        'first last';
    align-items: center;
}

.main__page-nav p.next {
    grid-area: next;
    width: 60%;
    justify-self: center;
    text-align: end;

    animation: fade-in linear;
    animation-timeline: view();
    animation-range-start: 0;
    animation-range-end: 20vh;

    color: var(--LIGHT-PRIMARY-COLOR);
    font: 4rem var(--BODY-FONT);
    line-height: 3rem;

    span:is(:hover, :focus) {
        display: inline-block;
        transform: translate(-1.5rem) scale(105%);
        transition: transform 1s ease-out;
        cursor: pointer;
    }

    span:is(:hover, :focus)::after {
    content: " >";
}

}

.main__page-nav p.previous {
    grid-area: prev;
    width: 60%;
    justify-self: center;
    text-align: start;

    animation: fade-in linear;
    animation-timeline: view();
    animation-range-start: 0;
    animation-range-end: 20vh;

    color: var(--LIGHT-PRIMARY-COLOR);
    font: 4rem var(--BODY-FONT);
    line-height: 3rem;

    span:is(:hover, :focus) {
        display: inline-block;
        transform: translate(-1.5rem) scale(105%);
        transition: transform 1s ease-out;
        cursor: pointer;
    }
    
    span:is(:hover, :focus)::before {
        content: "< ";
    }
}



.main__page-nav p.first {
    grid-area: first;
    text-align: start;
    
    animation: fade-in linear;
    animation-timeline: view();
    animation-range-start: 0;
    animation-range-end: 10vh;

    color: var(--LIGHT-SECONDARY-COLOR);
    font: 2em var(--BODY-FONT); 
    
    span:is(:hover, :focus) {
        display: inline-block;
        transform: translate(-1.5rem) scale(120%);
        transition: transform 1s ease-out;
        cursor: pointer;   
    }

    span:is(:hover, :focus)::before {
        content: "<< "; 
    }
    
}


.main__page-nav p.last {
    grid-area: last;
    text-align: end;

    animation: fade-in linear;
    animation-timeline: view();
    animation-range-start: 0;
    animation-range-end: 10vh;

    color: var(--LIGHT-SECONDARY-COLOR);
    font: 2em var(--BODY-FONT);

    span:is(:hover, :focus) {
        display: inline-block;
        transform: translate(1.5rem) scale(120%);
        transition: transform 1s ease-out;
        cursor: pointer;
    }

    span:is(:hover, :focus)::after {
        content: " >>";
    }

}


.main--contact {
    grid-area: mn;
    display: flex;
    align-items: center;
}

.main--contact__form {
    border: var(--BORDER);
    background-color: var(--LIGHT-PRIMARY-COLOR);
    width: 85%;
    padding: 5%;
    
    display: grid;
    gap: 2rem;

    > p:has(button) {
        display: flex;
        justify-content: end;
    }

}

.main--contact__form__item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: 1rem;
}

.main--contact__form__lbl {
    color: var(--LIGHT-FORM-COLOR);
    font: var(--NORMAL-FONT);
}

.main--contact__form__ctl {
    width: 100%;
    border: var(--BORDER);
}

.main--contact__form__ctl:not(textarea) {
    height: 35px
}

.main--contact__form__btn {
    padding: 0.5rem 1rem;
    border: var(--BORDER);
    background-color: var(--LIGHT-SECONDARY-COLOR);
    font: var(--NORMAL-FONT);
}

.aside {
    max-height: 50vh;

    animation: fade-in linear;
    animation-timeline: view();
    animation-range: 0 80vh;

}

.aside__header {
    padding: 1.5rem;
    color: var(--LIGHT-TEXT-COLOR);
    font: var(--TITLE-FONT);
}

.aside__carousel {
    padding: 0 15% 0;
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;

    > .aside__article {
        scroll-snap-align: center;
        
    }
}

.aside__article {
    flex: 0 0 60%;
    min-width: 350px;
    max-width: 750px;
    height: 40vh;
    background-color: var(--LIGHT-CONTENTBG);
    border: var(--BORDER);
    overflow-y: auto;
}

.aside__article__title {
    padding: 1.5rem;
    border-bottom: var(--BORDER);
    color: var(--LIGHT-PRIMARY-COLOR);
    font: var(--FONT-WEIGHT) 2rem var(--HEADINGS-FONT);
}

.aside__article__text {
    padding: 1.5rem;
    color: var(--LIGHT-TEXT-COLOR);
    font: var(--FONT-WEIGHT) var(--ASIDE-BODY-FONT-SIZE) var(--BODY-FONT);
    white-space: pre;
}

/* TODO checkout other way for serving audio and styling */
.aside__article__audio {
    width: 100%;
    padding: 5%;
    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 1rem;

    > p {
        color: var(--LIGHT-TEXT-COLOR);
        font: var(--FONT-WEIGHT) var(--ASIDE-BODY-FONT-SIZE) var(--BODY-FONT);
        white-space: pre;
        line-height: 2.5rem;
    }
}

.aside__article__audio__player {
    width: 100%;
    padding: 0 10% 0 5%;
    background-color: var(--LIGHT-PRIMARY-COLOR);
    border-radius: 50px;
    min-height: var(--SM-AUD-SIZE-WEB);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 2rem;


    > .control {
        flex: 1;
        border-radius: 50px;
        border: none;
        max-width: 70px;
        aspect-ratio: 1 / 1;
        font: var(--FONT-WEIGHT) 1.5rem var(--BODY-FONT);
        color: var(--LIGHT-PRIMARY-COLOR);
        background-color: var(--LIGHT-BGCOLOR);  

    }

    > .screen {
        flex: 4;
        min-height: var(--SM-AUD-SIZE-WEB);
        border-radius: 50px;
        background-color: var(--LIGHT-SECONDARY-COLOR);
        display: flex;
        flex-flow: column nowrap;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        padding: 0.35rem 0;

               

        > p {
            flex: 1;
            font: 700 1rem var(--SPECIAL-FONT-A);
            color: var(--LIGHT-FORM-COLOR);

        }

        > .screen__details {
            border: 0.2px solid var(--LIGHT-BGCOLOR);
            width: 80%;
            flex: 4;
            background-color: #D9D9D9;
            font: var(--FONT-WEIGHT) 1rem var(--SPECIAL-FONT-B);
            color: var(--LIGHT-TEXT-COLOR);
            display: flex;
            flex-direction: column;
            align-items: left;
            justify-content: center;
            
            > .progress-container {
                margin-left: 5%;
                width: 90%;
                height: 8px;
                border: 0.2px solid black;

                > .progress-bar {
                    width: 0%;
                    height: 100%;
                    background-color: var(--LIGHT-ACCENT-COLOR);

                }

            }
            
        }


    }
}


.aside__article__fig {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 75%;

    gap: 1rem;
    color: var(--LIGHT-TEXT-COLOR);
    font: var(--FONT-WEIGHT) var(--ASIDE-BODY-FONT-SIZE) var(--BODY-FONT);
    text-align: center;
}

.aside__article__fig__img {
    max-height: 100%;
    width: auto;
}


.footer {
    width: 100%;
    min-height: 50vh;
    padding: 2rem;
    display: flex;
    flex-flow: column nowrap;
    justify-content: end;

    animation: fade-in linear;
    animation-timeline: view();
    animation-range: entry;
}

.footer__nav {
    width: 100%;
    padding: 2rem 0rem;
}

.footer__nav__ul {
    list-style: none inside;
    display: flex;
    justify-content: end;
    gap: 5%;
}

.footer__nav__ul_li a:any-link  {
    display: inline-block;
    color: var(--LIGHT-TEXT-COLOR);
    font: var(--NAV-FONT);
    text-decoration: none;
}

.footer__nav__ul_li a:is(:hover, :focus) {
    color: var(--LIGHT-PRIMARY-COLOR);
    transform: translate(-1.5rem) scale(120%);
    transition: transform 1s ease-in-out;
}

.footer__copy {
    color: var(--LIGHT-TEXT-COLOR);
    font: 7rem var(--HEADINGS-FONT);
}

.footer__copy--mobile {
    display: none;
}

.footer--contact {
    grid-area: ft;
    width: 90%;
}


/* TODO mobile layout and styling */
@media screen and (max-width: 481px) {
    
    /* Header - Dropdown Navigation */
    .header {
        position: relative;
        overflow: visible;
        animation: none;
        margin-bottom: 0;
        align-items: center;
    }

    @keyframes slide-from-top {
        from {
            top: 50px;
            opacity: 0;
        }

        to {
            top: 60px;
            opacity: 1;
        }

    }

    .header__nav__toggle:checked {
        ~ .header__nav__ul {    
            top: 60px;
            right: 30px;
            left: auto;
            animation: slide-from-top 0.5s;
            }

        ~ .header__nav__ul--cat {
            top: 60px;
            left: 30px;
            animation: slide-from-top 0.5s;

        }

        ~ .header__nav__mask {
            display: block;
        }
    }

    .header__nav__mask {
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0; opacity: 0;
        z-index: 20;
        display: none;
    }

    .header__nav__title {
        display: inline-block;
        color: var(--LIGHT-TEXT-COLOR);
        font: var(--NAV-FONT-MOBILE);
        cursor: pointer;
    }

    @keyframes slide-to-top {
        from {
            top: 60px;
            right: 30px;
            left: auto;
            opacity: 1;
        }

        to {
            top: 50px;
            right: 30px;
            left: auto;
            opacity: 0;
        }

    }

    .header__nav__ul {
        padding: 1rem 0.5rem 1rem 4rem;
        border: var(--BORDER);
        background-color: var(--LIGHT-SECONDARY-COLOR); 
        line-height: 2.3;

        position: absolute;
        z-index: 25;
        left: -1000px;
        animation: slide-to-top 0.5s;
    }

    @keyframes slide-to-top-cat {
        from {
            top: 60px;
            left: 30px;
            opacity: 1;
        }

        to {
            top: 50px;
            left: 30px;
            opacity: 0;
        }

    }

    .header__nav__ul--cat {
        padding: 1rem 4rem 1rem 0.5rem;
        border: var(--BORDER);
        background-color: var(--LIGHT-SECONDARY-COLOR); 
        line-height: 2.3;

        position: absolute;
        z-index: 25;
        top: -1000px;
        animation: slide-to-top-cat 0.5s;
    }

    :is(.header__nav__ul_li, .header__nav__ul_li--cat) a:any-link  {
        font: var(--NAV-FONT-MOBILE);
    }

    :is(.header__nav__ul_li, .header__nav__ul_li--cat) a:active {
        color: var(--LIGHT-PRIMARY-COLOR);
    }

    .header__title {
        font: var(--FONT-WEIGHT) 3rem var(--HEADINGS-FONT);
    }

    /* Header Contact */
    .body--contact {
        display: flex;
        flex-direction: column;
    }

    .header--contact {
        margin: 0;
        flex: 1 1 1;
        flex-flow: row nowrap;
        justify-content: space-between;
        align-items: start;
    }

    .header--contact__title {
        font: var(--FONT-WEIGHT) 3rem var(--HEADINGS-FONT);
    }
    
    .header--contact__nav {
        display: block;
        flex-flow: row nowrap;
        justify-content: space-between;
    }
    
    .header--contact__copy {
        display: none;
    }

    
    /* Main - Sizes */

    .main__article {
        width: 90%;
        min-height: 80vh;
    }

    .main__article__title {
        font-size: 2.25rem;
    }

    .main__article__text, .main__article__fig {
        font-size: 1rem;
    }

    
    /* Main - Contact */
    
    .main--contact {
        flex: 5 1 3;
    }


    .main--contact__form {
        width: 100%;
    }


    /* Footer - Copyright */
    .footer__copy {
        display: none;
    } 

    .footer__copy--mobile {
        display: block;
        color: var(--LIGHT-TEXT-COLOR);
        font: 5rem var(--HEADINGS-FONT);
    }

    

    /* Footer - Contact */

    .footer--contact {
        flex: 1;
        width: 100%;
        display: flex;
        align-items: end;
        justify-content: center;
    }


    /* Footer - Dropdown Menu */

    .footer {
        position: relative;
        animation: none;
    }

    .footer__nav__title {
        display: block;
        color: var(--LIGHT-TEXT-COLOR);
        font: var(--NAV-FONT-MOBILE);
        cursor: pointer;
        text-align: end;
    }

    @keyframes slide-to-bot {
        from {
            top: -40px;
            right: 30px;
            left: auto;
            opacity: 1;
        }

        to {
            top: -30px;
            right: 30px;
            left: auto;
            opacity: 0;
        }

    }

    .footer__nav__ul {
        padding: 1rem 0.5rem 1rem 4rem;
        border: var(--BORDER);
        background-color: var(--LIGHT-SECONDARY-COLOR); 
        line-height: 2.3;
        flex-direction: column;
        text-align: right;
        
        z-index: 25;
        position: absolute;
        top: 0;
        left: -1000px;
        animation: slide-to-bot 0.5s;    

    }

    .footer__nav__ul_li a:any-link  {
        font: var(--NAV-FONT-MOBILE);
    }

    .footer__nav__mask {
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0; opacity: 0;
        z-index: 20;
        display: none;
    }

    @keyframes slide-from-bot {
        from {
            top: -30px;
            opacity: 0;
        }

        to {
            top: -40px;
            opacity: 1;
        }

    }
    
    .footer__nav__toggle:checked {
        ~ .footer__nav__ul {
            display: block;    
            top: -40px;
            right: 30px;
            left: auto;

            animation: slide-from-bot 0.5s;
        }

        ~ .footer__nav__mask {
            display: block;
        }
    }

    .footer--contact .footer__nav {
        display: none;
    }

    /* Animation */

    @keyframes fade-out-mobile {
        from {
            opacity: 1;
        }

        to {
            transform: translateY(5vh) rotateX(20deg);
            opacity: 0;
        }

    }

    @keyframes fade-in-mobile {
        from {
            scale: .8; 
            opacity: 0;
        }

        to {
            scale: 1;
            opacity: 1;
        }

    }

    .header__logo, .header__title,.header__nav__title {
        animation: fade-out-mobile linear;
        animation-timeline: view();
        animation-range: exit;
    }
    
    .footer__copy--mobile, .footer__nav__title {
        animation: fade-in-mobile linear;
        animation-timeline: view();
        animation-range: entry;
    }


}

