/* Body fade in animation */
main section:first-child>h1 {
    opacity: 0;
    animation: fadeIn 1.5s forwards ease-out 0.5s;
}

main section:first-child>h2 {
    opacity: 0;
    animation: fadeIn 1.5s forwards ease-out 1.5s;
}

main .mission-statement {
    animation: fadeIn 1s forwards ease-out 2.5s;

    &>blockquote::before,
    &>blockquote::after {
        animation: fadeIn 1s forwards ease-out 2.5s;
    }
}

main section:not(section:first-child) {
    opacity: 0;
    animation: fadeIn 1.5s forwards ease-out 3.5s;
}


/* Styles */
body {
    overflow: hidden !important;
}

main section {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-block: 50px;
    overflow: hidden;
}

main section:nth-child(even) {
    background-color: lightgrey;
    color: black;
}

main section:nth-child(odd) {
    background-color: black;
    color: white;
}

main section:has(video) {
    justify-content: center;
    align-items: center;
}

main section:has(.cards) {
    height: 650px;
}

main section>h1 {
    text-align: center;
    font-size: 72px;
    text-shadow: 1px 1px 5px white;
    /* margin-top: 100px; */
}

main section>h2 {
    margin-top: 25px;
    text-align: center;
    font-size: 64px;
    background: -webkit-linear-gradient(#fff, #999);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

main .video-container {
    position: relative;
    width: 90%;
    height: 90%;
}

main .video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

main img.volume-controller {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 25px;
    height: 25px;
    margin: 10px;
    user-select: none;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;

    &:hover {
        opacity: 0.8;
    }

    &:active {
        opacity: 0.6;
    }
}

main .video-subtitle {
    width: 90%;
    text-align: right;
    margin-top: 5px;
}

main .mission-statement {
    padding-inline: 50px;
    margin-top: 100px;
}

main blockquote {
    position: relative;
    text-align: center;
    font-size: 26px;
    font-family: Tinos, serif;
    line-height: 1.2;

    &::before,
    &::after {
        content: '"';
        font-size: 48px;
        margin: 0 5px;
        opacity: 0;
    }
}

main .mission-statement>.citation {
    position: relative;
    font-weight: bold;
    font-size: 28px;
    font-family: Tinos, serif;
    text-align: right;
    margin-top: 50px;
    margin-right: 50px;
}


/* Card flip effect */
.cards {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: 100px;
    perspective: 1000px;
    overflow: visible;
}

.card {
    position: absolute;
    width: 225px;
    aspect-ratio: 2.5 / 3.5;
    transform-style: preserve-3d;
    transform-origin: 50% 100%;
    transition: 0.3s;
    user-select: none;
    cursor: pointer;

    &:not(.active):hover {
        translate: 0 -50px;
    }

    &:not(.active):hover::after {
        visibility: visible;
        opacity: 1;
    }
}

/* the "more in future" card */
.card:first-child .back {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
}

.card .front,
.card .back {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 10px;
    text-align: center;
    background-color: lightskyblue;
    border: 2px solid white;
    border-radius: 15px;
    filter: hue-rotate(calc(var(--idx) * 50deg)) grayscale(20%);
    backface-visibility: hidden;
    transition: 0.3s;
    -webkit-backface-visibility: hidden;

    &:hover {
        box-shadow: 0 0 10px white;
    }

    &:active {
        box-shadow: 0 0 20px white;
    }
}

.card::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    top: -50px;
    width: max-content;
    height: auto;
    background-color: rgba(39, 39, 39, 0.8);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    font-size: 1.5rem;
    padding: 5px;
    border-radius: 5px;
    transform: translateX(-50%);
    transition: 0.3s;
    visibility: hidden;
    overflow: hidden;
    opacity: 0;
    z-index: 1;
}

.card .front {
    font-size: 1.8rem;
    font-weight: bold;
    word-break: break-word;
}

.card .front>h1 {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    line-break: auto;
}

.card .back {
    background-color: black;
    transform: rotateY(180deg);
    filter: none;
    padding: 5px;
}

.card .back img {
    width: 100%;
    height: 30%;
    object-fit: cover;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.card .back>p {
    font-size: 1rem;
    margin-top: 10px;
    line-height: 1.25;
    text-align: center;
}

.cards:hover>.card,
.cards:has(.card.active)>.card {
    transform: rotate(calc(var(--idx) * 10deg)) translate(calc(var(--idx) * 125px), -50px);
}

.card.active {
    top: 50%;
    transform: rotateY(180deg) translateY(-50%) !important;
    z-index: 1;
}

.cards:has(.card.active)>.card:not(.active) {
    filter: brightness(0.5) blur(3px);
}

.card-hint {
    position: relative;
    text-align: center;
}

.show-mobile {
    display: none;
}

.hide-mobile {
    display: block;
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media only screen and (max-width: 600px) {
    .show-mobile {
        display: block;
    }

    .hide-mobile {
        display: none;
    }

    main section {
        padding-block: 25px;
    }

    main section>h1 {
        font-size: 60px;
    }

    main section>h2 {
        font-size: 36px;
        padding-inline: 20px;
    }

    main .mission-statement {
        padding-inline: 20px;
        margin-top: 50px;
    }

    main .mission-statement>.citation {
        font-size: 24px;
        margin-right: 25px;
        margin-top: 25px;
    }

    main blockquote {
        font-size: 16px;
        line-height: 1.2;
    }

    main blockquote::before,
    main blockquote::after {
        font-size: 16px;
    }

    main .video-subtitle {
        margin-top: 0;
    }

    main img.volume-controller {
        display: none;
    }

    .cards {
        margin-top: 50px;
    }
}