/* ---------------- Global variables ---------------- */

:root {
    --white: #f3f3f3;
    --black: #1a191a;
    --accent: #f12551;
    --accent-active: #b11436;
    --text: #3e3e3e;
    --text-strong: #111111;
    --white-text: #cccccc;
    --white-text-strong: #f3f3f3;
    font-size: 17px;
}

/* ---------------- Common element styles ---------------- */

html {
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--white);
    background-image: url("../images/background-grid.png");
    background-attachment: fixed;
    font-family: Arial, sans-serif;
    color: var(--text);
    overflow-y: scroll;
}

::selection {
    background-color: #f1255199;
}

/* Headings */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Nunito", sans-serif;
    color: var(--text-strong);
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.4rem;
}

h4 {
    font-size: 1.2rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
iframe {
    margin: 1rem 0;
}

hr {
    width: 100%;
    height: 2px;
    margin-left: 0;
    margin-right: 0;
    border: none;
    background-color: #afafaf;
    animation: expand-hr ease-out 0.5s;
}

@keyframes expand-hr {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

/* Links */

a {
    color: var(--accent);
    transition: color 0.125s ease-out;
}

a:visited {
    color: #b81767;
}

.dark-section a,
.dark-section a:visited {
    color: var(--white-text);
}

a:hover,
a:focus,
.dark-section a:hover,
.dark-section a:focus {
    color: var(--accent);
}

a:active,
.dark-section a:active {
    color: var(--accent-active);
}

/* Lists */

ul,
menu {
    list-style: disc;
    padding-left: 1rem;
}

ol {
    list-style: decimal;
    padding-left: 1rem;
}

/* ---------------- Organizational element styles ---------------- */

.dark-section {
    background-color: var(--black);
    color: var(--white-text);
}

.dark-section h1,
.dark-section h2,
.dark-section h3,
.dark-section h4,
.dark-section h5,
.dark-section h6 {
    color: var(--white-text-strong);
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem;
}

main .content {
    background-color: var(--white);
    box-shadow: 0 0 256px var(--white);
}

/* ---------------- Special element styles ---------------- */

.basic-image {
    border-radius: 5px;
    box-shadow: 0 10px 8px #0000001c;
}

/* Basic buttons */

.basic-button {
    display: block;
    width: fit-content;
    padding: 1rem;
    margin: 1rem 0;
    border: none;
    border-radius: 5px;
    background-color: #424042;
    font-size: 1rem;
    color: var(--white-text-strong);
    text-decoration: none;
    transition-property: background-color, color;
    transition-duration: 0.125s;
    transition-timing-function: ease-out;
}

.basic-button:visited {
    color: var(--white-text-strong);
}

.basic-button:hover,
.basic-button:focus {
    color: var(--white-text-strong);
    background-color: var(--black);
}

.basic-button:active {
    color: var(--white-text-strong);
    background-color: var(--black);
}

/* Single-line bullets */

.single-line-bullets {
    display: flex;
    padding: 0;
    list-style-position: inside;
}

.single-line-bullets li {
    padding-left: 6px;
    padding-right: 0;
    list-style-type: "\2022  ";
}

.single-line-bullets li:first-child {
    padding-left: 0;
    list-style-type: none;
}

@media only screen and (max-width: 560px) {
    .single-line-bullets {
        flex-direction: column;
    }

    .single-line-bullets li {
        padding-left: 0;
    }

    .single-line-bullets li:first-child {
        list-style-type: "\2022  ";
    }
}

/* Video player */

.player-container {
    position: relative;
    --animation: player-wipe-after-start ease-out 0.25s;
}

.player-container::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    background-color: var(--accent);
    position: absolute;
    top: 0;
    animation: var(--animation);
    animation-fill-mode: both;
    pointer-events: none;
    visibility: visible;
}

@keyframes player-wipe-after-start {
    0% {
        width: 0;
        left: 0;
    }

    10% {
        width: 0;
        left: 0;
    }

    100% {
        width: 100%;
        left: 0;
    }
}

@keyframes player-wipe-after-end {
    0% {
        width: 100%;
        left: 0;
    }

    100% {
        width: 0;
        left: 100%;
    }
}

.player-container>* {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 5px;
}

/* Social icons, back-to-top button, and modal close button */

.graphic-button {
    opacity: 60%;
    transition: opacity 0.125s ease-out;
}

.graphic-button:hover,
.graphic-button:focus {
    opacity: 85%;
}

.graphic-button:active {
    opacity: 100%;
}

/* ---------------- Common animation styles ---------------- */

.pause-until-view {
    --pause-until-view: paused;
}

.underline-hover,
.underline-hover-block {
    position: relative;
}

.underline-hover::after,
.underline-hover-block::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    margin: 0 auto;
    border-radius: 0 0 5px 5px;
    background-color: var(--accent);
    position: absolute;
    left: 0;
    right: 0;
    transition-property: width, background-color;
    transition-duration: 0.125s;
    transition-timing-function: ease-out;
    pointer-events: none;
}

.underline-hover:hover::after,
.underline-hover:focus::after,
.underline-hover-block:hover::after,
.underline-hover-block:focus::after {
    width: 100%;
}

.underline-hover:active::after,
.underline-hover-block:active::after {
    background-color: var(--accent-active);
}

.underline-hover-block {
    border: none;
    border-bottom: var(--black) solid 4px;
    border-radius: 5px;
}

.underline-hover-block:after {
    height: 4px;
    bottom: -4px;
}

.info-block {
    animation: info-block-appear 0.5s ease-out;
    animation-fill-mode: both;
    opacity: 0;
    transform: translateY(100px);
}

.info-block:nth-child(1) {
    animation-delay: 0.05s;
}

.info-block:nth-child(2) {
    animation-delay: 0.15s;
}

.info-block:nth-child(3) {
    animation-delay: 0.25s;
}

@keyframes info-block-appear {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }

    100% {
        opacity: 100;
        transform: none;
    }
}

@media only screen and (max-width: 920px) {
    .info-block {
        animation-delay: 0s !important;
    }
}

/* Wipe animation */

.wipe-anim {
    animation: wipe ease-out 0.5s;
    position: relative;
}

@keyframes wipe {
    0% {
        color: var(--accent);
        visibility: hidden;
    }

    50% {
        color: var(--accent);
        visibility: hidden;
    }

    51% {
        color: var(--accent);
        visibility: visible;
    }

    100% {
        color: var(--text-strong);
        visibility: visible;
    }
}

.wipe-anim::after {
    content: "";
    display: block;
    width: 0;
    height: 100%;
    background-color: var(--accent);
    position: absolute;
    top: 0;
    animation: wipe-after ease-out 0.5s;
    animation-play-state: var(--pause-until-view);
    pointer-events: none;
    visibility: visible;
}

@keyframes wipe-after {
    0% {
        width: 0;
        left: 0;
    }

    50% {
        width: 100%;
        left: 0;
    }

    100% {
        width: 0;
        left: 100%;
    }
}

/* ---------------- Header styles ---------------- */

header {
    z-index: 64;
}

header .content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
}

#title a {
    text-decoration: none;
    color: var(--white-text-strong);
}

#title a:visited {
    color: var(--white-text-strong);
}

#title a:hover,
#title a:focus {
    color: var(--accent);
}

#title a:active {
    color: var(--accent-active);
}

@media only screen and (max-width: 720px) {
    #title {
        width: 100%;
        text-align: center;
    }

    #nav {
        width: 100%;
        justify-content: center;
    }
}

/* Navigation */

#nav {
    display: flex;
    padding: 0;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    list-style: none;
}

.nav-item.current {
    font-weight: bold;
}

.nav-item a {
    color: var(--white-text);
    text-decoration: none;
}

.nav-item.current a {
    color: var(--white-text-strong);
}

.nav-item:hover a,
.nav-item:focus a {
    color: var(--accent);
}

.nav-item:active a {
    color: var(--accent-active);
}

.nav-item::after {
    bottom: -0.5rem;
    background-color: var(--white-text);
}

.nav-item.current::after {
    width: 100%;
    background-color: var(--white-text-strong);
}

.underline-hover:hover::after,
.underline-hover:focus::after {
    background-color: var(--accent);
}

.nav-item:active::after {
    background-color: var(--accent-active);
}

@media only screen and (max-width: 420px) {
    #nav {
        flex-direction: column;
        gap: 2rem;
    }

    .nav-item::after {
        width: 100%;
        background-color: var(--text);
    }
}

/* ---------------- Footer styles ---------------- */

footer {
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-top: auto;
    z-index: 64;
}

footer .content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

footer h3 {
    margin-top: 0;
}

#social-icons {
    display: flex;
    padding: 0;
    gap: 0.5rem;
    list-style: none;
}

.social-icon {
    width: 2.2rem;
}

/* Right section */

#footer-right {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: end;
    margin-left: auto;
}

#footer-right p {
    margin-bottom: 0;
    opacity: 30%;
}

@media only screen and (max-width: 840px) {
    #footer-right {
        width: 100%;
        flex-direction: row-reverse;
        align-items: start;
        gap: 1rem;
    }

    #footer-right p {
        margin-top: 0;
    }
}

/* Back to top button */

#back-to-top {
    height: 2.2rem;
}

#back-to-top img {
    width: 2.2rem;
    transition: transform 0.125s ease-out;
    pointer-events: none;
}

#back-to-top:hover img,
#back-to-top:focus img {
    transform: translate(0, -0.5rem);
}

/* ---------------- Image modal ---------------- */

.modal-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    background-color: #e9e9e9;
    box-shadow: 0 10px 8px #0000001c;
    transition: box-shadow 0.125s ease-out;
    cursor: pointer;
}

.modal-image:hover,
.modal-image:focus {
    box-shadow: 0 0 64px #b1143688;
}

.modal-image>* {
    pointer-events: none;
}

.modal-image img {
    display: block;
    width: 100%;
    border-radius: 5px 5px 0 0;
}

.modal-image p {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    text-align: center;
}

/* Modal */

#image-modal {
    width: 100%;
    height: 100%;
    position: fixed;
    background-color: #00000088;
    backdrop-filter: blur(10px);
    z-index: 128;
    transition: opacity 0.125s ease-out;
}

#image-modal .content {
    display: flex;
    flex-direction: column;
}

#image-modal-figure {
    font-size: 1.1rem;
    text-align: center;
}

#image-modal-image {
    display: flex;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16/9;
    margin-bottom: 1rem;
}

#image-modal-image img {
    max-width: 100%;
    height: 100%;
    border-radius: 5px;
    transition: transform 0.125s ease-out;
}

.image-modal-close {
    width: 2rem;
    height: 2rem;
    padding: 0.75rem;
    margin: 0;
    position: absolute;
    border-radius: 5px;
    top: 3rem;
    right: 3rem;
    background-color: #00000077 !important;
    z-index: 130;
    cursor: pointer;
}

.image-modal-close img {
    width: 100%;
    height: 100%;
}