@font-face {
    font-family: 'Bricolage Grotesque';
    src: url(BricolageGrotesque-Regular.ttf) format('woff2');
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body { 
    font-family: "Bricolage Grotesque", -apple-system, sans-serif;
    background: #fff;
    color: #ee1100;
    overflow-x: hidden;
}

a {
    color: #ee1100;
}

a:hover {
    text-decoration: none;
}

::selection {
    color: #fff;
    background: #ee1100;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 101px;
    z-index: 999;
    padding: 2rem;
    background-color: #fff;
    border-bottom: 1rem solid #fff;
}

footer {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    height: 100px;
    width: 100%;
    padding: 2rem;
    background-color: #fff;
    margin-top: 100px;
    position: relative;
    bottom: 0;
}

footer div{
    padding: 0.5rem;
}

footer div:nth-child(2){
    text-align: center;
}

footer div:nth-child(3){
    text-align: right;
}

.header-wrapper{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    text-decoration: none;
}

.logo.nav-active {
    font-style: italic;
}

nav a {
    color: #ee1100;
    text-decoration: none;
    font-size: 1.5rem;
}

nav a:hover {
    text-decoration: underline;
}

nav a.nav-active {
    font-style: italic;
}

nav a.nav-active:hover {
    text-decoration: none;
    cursor: default;
}

.main-container {
    padding: 0 0.5rem 0 0.5rem;
    margin-top: 92px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    gap: 0;
}

.project {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #fff;
    padding: 0.5rem;
    height: 100%;
}

.project-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1.5rem;
    transition: opacity 0.1s ease-in, background-color 0.2s ease-in;
}

.project:hover .project-overlay {
    background-color: #fff;
    color: #ee1100;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
    transition: transform 0.2s ease-out;
}

.project-category {
    font-size: 1rem;
    color: #fff;
    transition: transform 0.2s ease-out;
}

.product-page-navigation {
    margin-top: 2rem;
}

.product-page-navigation a {
    margin-right: 1rem;
}

.product-page-navigation span {
    margin-right: 1rem;
    cursor: default;
}

.project:hover .project-title {
    transform: translateY(-10px);
    text-decoration: underline;
    color: #ee1100;
}

.project:hover .project-category {
    transform: translateY(-10px);
    color: #ee1100;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0;
    margin: 50px 0 50px;
}

.about-content {
    grid-column: 2/4;
    grid-row: 2/3;
    padding: 1rem;
    line-height: 1.5rem;
}

.about-image {
    grid-column: 1/2;
    grid-row: 1/2;
    padding: 0.5rem;
}

.product-page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0;
    margin: 50px 0 50px;
}

#product-3d-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#product-3d-viewer.active {
    display: flex;
}

.product-3d-viewer__hidden {
    display: none !important;
}

#viewer-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

#viewer-canvas.loaded {
    opacity: 1;
}

.viewer-loading::after {
    content: '...';
    display: inline-block;
    width: 20px;
    text-align: left;
    animation: dots 2s linear infinite;
}

.viewer-loading.error::after {
    content: '';
    /* display: inline-block; */
    animation: none;
}

@keyframes dots {
    0% { content: '   '; }
    30% { content: '.  '; }
    50% { content: '.. '; }
    75% { content: '...'; }
}

#close-3d-viewer {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #ee1100;
    text-decoration: underline;
    z-index: 10;
    font-size: 1.5rem;
}

#close-3d-viewer:hover {
    text-decoration: none;
}

.download-container {
    width: 100%;
    position: fixed;
    margin: 0 auto;
    bottom: 2rem;
    z-index: 10;
    text-align: center;
}

.download-container p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.download-button {
    margin: 0.5rem;
    padding: 0.2rem 0.3rem;
    color: #ee1100;
    border: #ee1100 1px solid;
    border-radius: 7px;
    text-decoration: none;
    font-size: 1rem;
} 

.download-button:hover {
    background-color: #ee1100;
    color: #fff;
}

#viewer-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ee1100;
    font-size: 18px;
}

.product-page-content {
    grid-column: 3/5;
    grid-row: 2/3;
    padding: 1rem;
    line-height: 1.5rem;
}

.about-content p, .product-page-content p {
    padding-bottom: 1rem;
}

ul.product-page-specs {
    list-style-type: circle;
}

ul.product-page-specs:before {
    content: "";
    display: block;
    width: 2rem;
    margin: 0.2rem 0 1rem 0;
    border-bottom: 2px solid #ee1100;
}

.product-page-specs li {
    margin: 0 0 0.2rem 1rem;
}

p.product-page-title {
    font-size: 1.2rem;
}

.product-page-image {
    padding: 0.5rem;
}

.product-page-image:nth-child(1) {
    grid-column: 1/2;
    grid-row: 1/2;
}

.product-page-image:nth-child(2) {
    grid-column: 2/3;
    grid-row: 2/3;
}

.product-page-image:nth-child(3) {
    grid-column: 3/4;
    grid-row: 1/2;
}

.product-page-image:nth-child(4) {
    grid-column: 4/5;
    grid-row: 1/2;
}

.about-image img, .product-page-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thingy span {
    display: inline-block;
    margin-right: 1rem;
    transition: transform 0.5s ease-in-out;
    cursor: none;
}

.thingy span:hover {
    transform: rotate(360deg);
}

@media (max-width: 1200px) {
    .grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
    
    .about-content {
        grid-column: 2/4;
    }

    .about-image {
        grid-column: 1/2;
    }

    .product-page-content {
        grid-column: 2/4;
    }

    .product-page-image:nth-child(1) {
    grid-column: 1/2;
    }

    .product-page-image:nth-child(2) {
        grid-column: 1/2;
    }

    .product-page-image:nth-child(3) {
        grid-column: 2/3;
    }

    .product-page-image:nth-child(4) {
        grid-column: 4/5;
    }

    header {
        padding: 1.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    nav a {
        margin-left: 1rem;
        font-size: 1.2rem;
    }

    .project-title {
        font-size: 1.2rem;
    }
    
    .project-overlay {
        padding: 1.5rem;
        font-size: 1rem;
    }

    #close-3d-viewer {
        font-size: 1.2rem;
        top: 1.5rem;
        right: 1.5rem;
    }

    .download-model {
        font-size: 1.2rem;
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }

    .about-image {
        grid-column: 1/3;
        grid-row: 1/1;
    }

    .about-content {
        grid-column: 2/5;
        grid-row: 2;
    }

    .product-page-content {
        grid-column: 2/5;
    }

    .product-page-image:nth-child(1) {
        grid-column: 1/3;
    }

    .product-page-image:nth-child(2) {
        grid-column: 3/5;
        grid-row: 1;
    }

    .product-page-image:nth-child(3) {
        grid-column: 1/4;
        grid-row: 3;
    }

    .product-page-image:nth-child(4) {
        grid-column: 2/5;
        grid-row: 4;
    }

    footer {
        grid-template-columns: 1fr;
        height: auto;
        text-align: center;
    }

    footer div:nth-child(3) {
        text-align: center;
    }
}

.project-media {
    background: #fff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project {
    animation: fadeIn 0.3s ease-in;
}