main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 5em;
}

section {
    width: 100dvw;
    max-width: 80em;
    padding-left: 1em;
    padding-right: 1em;
}

h1 {
    margin-bottom: 1rem;
    width: 60rem;
}

h2 {
    font-size: 1.2em;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 0.2em;
    font-style: italic;
}

p {
    margin-top: 0;
    width: 30em;
    font-size: 1.5em;
}

section:first-of-type {
    justify-self: center;
    margin-bottom: 5em;
    position: relative;
}

section:first-of-type img:last-of-type {
    max-height: 30rem;
    max-width: 40%;
    position: absolute;
    right: 1em;
    top: 0;
    /* filter: drop-shadow(0px 0px 20px #22222295); */
}

#awardsEmblem {
    height: 5em;
    /* filter: drop-shadow(0 0 10px var(--color-blue)); */
}  

section:first-of-type h1 {
    max-width: 75%;
}

section:first-of-type p {
    font-size: 2em;
    width: max-content;
}

section.titleBigPhoto h1 {
    max-width: 55%;
}

div.photosMobile {
    margin-top: 10em;
    margin-bottom: 5em;
    display: flex;
    justify-content: space-between;
    width: 100dvw;
    max-width: 80em;
    padding-left: 1em;
    padding-right: 1em;
}

div.bigPhoto {
    width: 100dvw;
    max-width: 80em;
    margin-bottom: 5em;
}

div.bigPhoto img {
    max-width: 100%;
}

div.photosMobile img {
    max-width: 27%;
    /* filter: drop-shadow(0px 0px 20px #22222295); */
}

div.photosMobile img:nth-of-type(1) {
    margin-top: 0em;
    margin-bottom: 6em;
}

div.photosMobile img:nth-of-type(2) {
    margin-top: 3em;
    margin-bottom: 3em;
}

div.photosMobile img:nth-of-type(3) {
    margin-top: 6em;
    margin-bottom: 0em;
}

div.photosDesktop {
    margin-top: 8em;
    margin-bottom: 5em;
    display: flex;
    justify-content: space-between;
    width: 100dvw;
    max-width: 80em;
    padding-left: 1em;
    padding-right: 1em;
}

div.photosDesktop img {
    max-width: 46%;
    /* filter: drop-shadow(0px 0px 20px #22222295); */
    align-self: start;
}

div.photosDesktop img:nth-of-type(1) {
    margin-top: 0em;
    margin-bottom: 6em;
}

div.photosDesktop img:nth-of-type(2) {
    margin-top: 6em;
    margin-bottom: 0em;
}

section.textPhoto {
    text-align: right;
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    height: max-content;
    position: relative;
    margin-bottom: 5em;
}

section.textPhoto img {
    max-height: 35rem;
    max-width: 45%;
    order: -1;
    /* filter: drop-shadow(0px 0px 20px #22222295); */
}

section.textPhoto>div {
    max-width: 50%;
    width: 40em;
    display: flex;
    margin-left: 4em;
    flex-direction: column;
    justify-content: end;
}

section.textPhoto.mirrored {
    text-align: start;
}

section.textPhoto.mirrored img {
    order: 2;
}

section.textPhoto.mirrored>div {
    justify-content: start;
    margin-left: 0;
    margin-right: 4em;
}

section.textPhoto>div p {
    width: 100%;
}

section.textOnly {
    margin-bottom: 5em;
}

section.specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20em, 1fr));
    row-gap: 3em;
    max-width: 80em;
    margin-bottom: 5em;
    text-wrap: wrap;
    align-items: baseline;
}

section.specs div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

section.specs p {
    width: 90%;
    text-align: center;
}

section.specs p.specTitle {
    font-size: 3em;
    font-weight: 800;
    margin-bottom: 0;
    font-family: 'Poltawski Nowy';
    font-style: italic;
}

section.specs p:last-of-type {
    font-size: 1.5em;
    font-weight: 400;
}

section.specs img {
    height: 4em;
    filter: invert(1);
}

section.demo {
    display: flex;
    margin-bottom: 1em;
    align-items: center;
    margin-bottom: 5em;
}

section.demo div:first-of-type {
    order: 1;
}

section.demo iframe {
    border: none;
}

section.demo iframe.video {
    aspect-ratio: 16 / 9;
    max-width: 50dvw;
    width: 40em;
}

section.demo p {
    width: 100%;
}

section.demo #iframebuttons {
    margin-top: 0.2em;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5em;
}

section.demo button {
    background-color: var(--color-footer);
    border: none;
    padding: 1em;
    color: var(--color-text-contrast);
    font-family: inherit;
    cursor: pointer;
    transition-duration: 0.3s;
}

section.demo button:hover {
    background-color: rgb(81, 81, 81);
}

section.demo div.iframeContents {
    margin-right: 5em;
}

section.aboutTitle {
    display: flex;
    justify-content: start;
    align-items: center;
}

section.aboutTitle div {
    width: 100%;
    margin-left: 3em;
}

section.aboutTitle h1 {
    margin: 0;
    height: max-content;
    width: max-content;
    max-width: 85%;
}

section.aboutTitle img {
    position: initial;
    order: -1;
    filter: none;
}

section.aboutTitle ul {
    width: max-content;
}

section.aboutTitle li {
    font-size: 1.5em;
    margin-left: 1em;
    padding-left: 0.5em;
    list-style-type: disc;
    width: max-content;
    max-width: 100%;
    text-wrap: wrap;
}

section.dateList {
    margin-bottom: 5em;
}

section.dateList li {
    display: flex;
    flex-direction: row;
    gap: 1em;
}

section.dateList li p:first-of-type {
    width: 25dvw;
    max-width: 10em;
    font-weight: 600;
}

section.dateList li p:last-of-type {
    width: 100%;
}

#portraitHex {
    width: 30em;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Hexagon mask, rotated 15deg */
    clip-path: polygon(
        50% 0%,
        93% 25%,
        93% 75%,
        50% 100%,
        7% 75%,
        7% 25%
    );
    transform: rotate(15deg);
    order: -1;
    margin: 0;
    animation: portraitRotation 30s linear infinite;
}

#portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    /* Counter-rotate so the image stays upright */
    transform: rotate(-15deg);
    max-width: none;
    animation: portraitRotationReverse 30s linear infinite;
    position: static;
}

@keyframes portraitRotation {
    0% {
        transform: rotate(15deg);
    }

    100% {
        transform: rotate(375deg);
    }
}

@keyframes portraitRotationReverse {
    0% {
        transform: rotate(-15deg);
    }

    100% {
        transform: rotate(-375deg);
    }
}

@media (max-width: 800px) {
    p {
        font-size: 1.1em;
    }

    section.demo {
        flex-direction: column;
        align-items: start;
    }

    section.demo iframe.video {
        max-width: 100%;
    }

    div.iframeContents {
        display: none;
    }

    section.demo div.iframeContents.notHidden {
        display: block;
        margin-right: 0;
    }

    main section p {
        width: 90dvw;
    }

    main>section:first-of-type {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-top: 0;
    }

    main>section:first-of-type h1 {
        max-width: 100%;
        font-size: 3em;
    }

    main>section:first-of-type img:last-of-type {
        position: static;
        max-width: 70dvw;
        max-height: 30em;
    }

    #awardsEmblem {
        margin-bottom: 2em;
    }

    div.photosMobile {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        margin-top: 2em;
    }

    div.photosMobile img {
        max-width: 40%;
    }

    div.photosMobile img:nth-of-type(3) {
        margin-top: 0;
    }

    section.textPhoto {
        display: flex;
        flex-direction: column;
    }

    section.textPhoto div {
        max-width: 90dvw;
        text-align: start;
        margin: 0;
    }

    section.textPhoto p {
        width: 90dvw;
    }

    section.textPhoto img {
        order: 1;
        max-width: 70dvw;
        max-height: 30em;
        margin: 0;
    }

    section.textPhoto.mirrored {
        display: flex;
        flex-direction: column;
    }

    section.textPhoto.mirrored div {
        max-width: 90dvw;
        text-align: start;
        margin: 0;
    }

    section.specs {
        margin-bottom: 1em;
        margin-top: 2em;
    }

    section.textOnly,
    section.dateList {
        margin-bottom: 0;
    }

    section.dateList li {
        display: block;
    }

    section.dateList li p {
        max-width: 100% !important;
        width: max-content !important;
    }

    section.dateList li p:first-of-type {
        margin-bottom: 0;
    }

    section.titleBigPhoto img {
        width: 30em;
        max-width: 90dvw;
    }

    div.photosDesktop {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2em;
        margin-top: 1em;
        margin-bottom: 2em;
    }

    div.photosDesktop img {
        width: 30em;
        max-width: 90dvw;
    }

    div.photosDesktop img:nth-of-type(1) {
        align-self: start;
        margin: 0;
    }

    div.photosDesktop img:nth-of-type(2) {
        align-self: end;
        margin: 0;
    }

    section.aboutTitle {
        text-align: center;
        display: flex;
        flex-direction: column;
        margin-top: 2em;
    }

    section.aboutTitle div {
        margin: 0;
        margin-top: 2em;
    }

    section.aboutTitle div h1 {
        width: 100%;
    }

    section.aboutTitle #portrait {
        width: 13em;
        height: 13em;
    }

    section.aboutTitle #portraitHex {
        width: 13em;
        height: 13em;
    }

    section.specs p.specTitle{
        font-size: 2em;
    }

    section.specs p:last-of-type{
        font-size: 1.2em;
    }
}

@media (max-width: 450px) {
    main>section:first-of-type h1 {
        font-size: 2em;
    }
}