*:not(#background) {
    z-index: 1;
}

/* Global variable for transition animation speeds */
:root {
    --btn-anim-speed: 0.15s;
    --btn-anim-size: 1.05;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 100%;
    text-align: center;
    color: #ffffffe1;
    background: black;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    width: 100%;
    height: 100%;
}

img {
    user-select: none;
}

#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    filter: blur(3px);
    opacity: 0.75;
    background-image: url('./public/background/background-640.webp');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

#page-content {
    max-width: 760px;
    margin: 0 auto;
}

.blurred {
    filter: blur(3px);
}

@media (min-width: 800px) {
    #background {
        background-image: url('./public/background/background-1280.webp');
    }
}

@media (min-width: 1200px) {
    #background {
        background-image: url('./public/background/background-1920.webp');
    }
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0.5rem;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
a {
    /* Drop shadow */
    text-shadow: 1px 1px 1px #00000050;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-content: center;
}

.container.reverse {
    flex-direction: column-reverse;
}

.container.horizontal.reverse {
    flex-direction: row-reverse;
}

.container.horizontal {
    flex-direction: row;
}

.container.loop-around {
    flex-wrap: wrap;
}

.one-screen-height {
    height: 100vh;
}

.section:not(.one-screen-height) {
    scroll-margin-top: 20vh;
}

.divider {
    /* Horizontal line */
    width: 15vw;
    height: 1px;
    background-color: #ffffffe1;
    margin: 8rem 0;
}

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

.min-width-10em {
    min-width: 10em;
}

.max-width-15em {
    max-width: 15em;
}

.min-width-20em {
    min-width: 20em;
}

.social-link {
    /* White circle outline around social-icon */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 1.5px solid #ffffffe1;
    padding: 1rem;
    margin: 0.5rem;
    transition: transform var(--btn-anim-speed);
}

.invert-black-svg {
    filter: invert(94%) sepia(0%) saturate(0%) hue-rotate(301deg)
        brightness(106%) contrast(107%);
}

.social-icon {
    max-height: 2em;
}

.social-link:hover {
    transform: scale(var(--btn-anim-size));
}

.section-icon {
    max-height: 1em;
    padding-right: 0.3em;
    transform: translateY(0.08em);
}

#top-bar {
    /* Fixed to the top, full width */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #00000030;
    transition: background-color var(--btn-anim-speed);
    /* Blur background */
    backdrop-filter: blur(3px);
}

#top-bar:hover {
    background-color: #00000080;
}

.rounded {
    border-radius: 100%;
}

.white-border {
    border: 2px solid #ffffffe1;
}

.m05 {
    margin: 0.5rem;
}

.m1 {
    margin: 1rem;
}

.container .f1 {
    flex: 1;
}

.container .f2 {
    flex: 2;
}

.container .f3 {
    flex: 3;
}

.container .f4 {
    flex: 4;
}

.container .f5 {
    flex: 5;
}

#logo {
    width: 10rem;
    height: auto;
    transition: transform var(--btn-anim-speed);
}

#logo:hover {
    transform: scale(var(--btn-anim-size));
}

a {
    color: #ffffffe1;
    text-decoration: none;
    position: relative;
}

/* Fade in */
a.underlining::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #ffffffe1;
    opacity: 0;
    transition: opacity 300ms, transform 300ms;
}

a.underlining.active::after,
a.underlining:hover::after {
    /* Underline */
    opacity: 1;
    transform: translate3d(0, 0.2em, 0);
}

a.btn {
    /* Minimalistic button with white text and white outline and a semi transparent black background */
    color: #ffffffe1;
    background-color: #00000030;
    border: 1.5px solid #ffffffe1;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.5em;
    text-shadow: 1px 1px 1px #00000030;
    transition: transform var(--btn-anim-speed);

    /* Center contents vertically */
    display: flex;
    align-items: center;
}

a.btn:hover {
    text-decoration: none;
    transform: scale(var(--btn-anim-size));
}

#scroll-cue {
    /* Arrow pointing down */
    display: none;
    position: fixed;
    font-size: 3rem;
    color: #ffffff50;
    bottom: 2rem;
    left: 50%;
    z-index: 2;
    cursor: pointer;
    transform: translateX(-50%);

    animation: bounceDown 2s infinite;
}

#scroll-cue > p {
    rotate: 90deg;
    animation: fadeOut 1s linear infinite;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1s);
    margin-left: -0.25rem;
}

#contact {
    scroll-margin-top: -300px;
    /* Extra space after contact */
    height: 90vh;
}

#headshot {
    width: 10rem;
}

.dctl-thumbnail img {
    border-radius: 0.5rem;
    transition: transform var(--btn-anim-speed);
}

.dctl-thumbnail:hover img {
    transform: scale(var(--btn-anim-size));
}

.button-icon {
    height: 1.5rem;
    padding-right: 0.5rem;
}

.in-text-icon {
    height: 1.5rem;
    padding-right: 0.5rem;
    transform: translateY(0.2rem);
}

.terminal-animated {
    width: 100%;
}

.red-link {
    color: #ff5f5c;
    text-decoration: underline;
    cursor: pointer;
}

.white-link {
    text-decoration: underline;
    cursor: pointer;
}

#vimeo-player {
    height: calc(760px / 1.78);
    width: 760px;
}

#grading-portfolio {
    margin-top: 25vh;
}

#grading-portfolio > .container {
    gap: 3rem;
}

.portfolio-card {
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border-radius: 0.5rem;
}

.image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: filter 0.3s ease;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

@media (max-width: 800px) {
    .overlay {
        font-size: 0.7em;
    }
}

.project-title {
    color: white;
    font-size: 3em;
    text-align: center;
}

.project-subtitle {
    color: white;
    font-size: 1.5em;
    text-align: center;
    font-weight: 100;
}

.portfolio-card.hover img,
.portfolio-card:hover img {
    filter: blur(2px);
}

.portfolio-card.hover .overlay,
.portfolio-card:hover .overlay {
    opacity: 1;
}

/* Mobile */
@media (max-width: 800px) {
    #top-bar {
        font-size: 75%;
    }

    .container:not(#top-bar) {
        /* Not to overwrite the padding bottom */
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    #logo {
        width: 7rem;
    }

    #vimeo-player {
        height: calc(560px / 1.78);
        width: 560px;
    }
}

@media (max-width: 600px) {
    #vimeo-player {
        height: calc(360px / 1.78);
        width: 360px;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes bounceDown {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(10px);
    }
    60% {
        transform: translateY(5px);
    }
}

#carousel.hidden {
    display: none;
}

#carousel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#carousel-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
}

#carousel-image {
    width: 90vw;
    height: 90vh;
    max-width: max(90vw, 90vh);
    max-height: max(90vw, 90vh);
    object-fit: contain;
    position: relative;
}

.carousel-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    /* shadow */
    text-shadow: 1px 1px 1px #00000050;
    font-size: 4em;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    transition: color 0.3s;
}

.carousel-button:hover {
    color: rgba(255, 255, 255, 0.7);
}

#carousel-prev {
    left: 10px; /* Adjusted to be on the image */
}

#carousel-next {
    right: 10px; /* Adjusted to be on the image */
}

#carousel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3em;
    cursor: pointer;
}

@media (max-width: 600px) {
    .carousel-button {
        font-size: 6em;
        padding: 8px;
    }

    #carousel-prev {
        left: 5px;
    }

    #carousel-next {
        right: 5px;
    }
}

.logos-container {
    background: #fff;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.logos-container img {
    transition: transform var(--btn-anim-speed);
}

.logos-container img:hover {
    transform: scale(var(--btn-anim-size));
}

.logos-container:not(.horizontal) {
    max-width: 70%;
}

.logos-container:not(.horizontal) {
    display: none;
}

@media (max-width: 600px) {
    #store-buttons {
        flex-direction: column;
    }

    .logos-container.horizontal {
        display: none;
    }

    .logos-container:not(.horizontal) {
        display: flex;
    }

    #landing > * {
        position: relative;
        top: -3em;
    }

    .logos-container > a.f1.m1 > img {
        width: 70%;
    }
}
