.page {
}

.page-error {
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.page-error-text {
    margin-bottom: 2rem;
    font-size: var(--text-btn1);
    text-transform: uppercase;
}

.page-error-bg {
    position: absolute;
    bottom: 0;
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.page-error-bg-text {
    font-size: 25vw;
    color: var(--color-green);
    text-align: center;
    translate: 0 2%;
}

.page-error-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(9, 43, 57, 0.75), rgba(9, 43, 57, 0));
}

@media screen and (min-width: 768px) {
    .page-error-bg{
        inset: 0;
    }

    .page-error-bg-text {
        font-size: 90vw;
    }
}

/* Hero */
.hero {
    
}

.hero-media {
    grid-column: 1/-1;
    height: 100svh;
    width: 100%;
    object-fit: cover;
}

.hero-copy {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    translate: 0 -50%;
}

.hero-headline {
    font-size: var(--text-h1);
    letter-spacing: -1%;
}

@media screen and (min-width: 768px) {
    .hero-copy {
        left: 2rem;
    }
}

/* Section: Science */
.science {
    padding: 6rem 0;
}

.science-copy {
    padding: 1.5rem;
    margin-bottom: 4rem;
}

.science-headline {
    margin-bottom: 2rem;
    font-size: var(--text-h2);
}

.science-body {
    padding: 1.5rem;
    font-size: var(--text-p1);
    margin-bottom: 3.5rem;
    line-height: 140%;
}

.science-patents {
    margin: 0;
    padding: 0;
    display: flex;
    list-style-type: none;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Mobile: horizontal scroll strip with snap-align */
.science-gallery-pin {
    grid-column: 1/-1;
    width: 100%;
}

.science-gallery {
    display: flex;
    width: 100%;
    gap: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 2rem;
}

.science-gallery::-webkit-scrollbar {
    display: none;
}

.science-gallery-picture {
    flex: 0 0 90vw;
    scroll-snap-align: start;
    height: 50vh;
}

.science-gallery-picture-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.science-gallery-controls {
    display: none;
}

@media screen and (min-width: 768px) {
    .science {
        padding: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .science-copy {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 12rem 2rem;
        margin-bottom: 0;
    }

    .science-body {
        padding: 12rem 2rem;
        margin-bottom: 0;
    }

    .science-gallery-pin {
        position: relative;
    }

    .science-gallery {
        position: relative;
        display: block;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        overflow: hidden;
        scroll-snap-type: none;
    }

    .science-gallery-picture {
        position: absolute;
        flex: initial;
        scroll-snap-align: none;
        top: 0;
        left: 100%;
        width: 100vw;
        height: 100%;
        transform: translateX(100%);
        transition: 0.6s ease;
    }

    .science-gallery-picture.is-active {
        top: 0;
        left: 0;
        transform: translateX(0);
    }

    .science-gallery-picture.is-prev {
        top: 0;
        left: -100%;
        transform: translateX(0);
    }

    /* Peek mode: active fills 75vw on the left, next slide peeks on the right */
    .science-gallery.has-peek .science-gallery-picture.is-active {
        width: calc(75vw - 1rem);
        top: 0;
        left: 0;
    }

    .science-gallery.has-peek .science-gallery-picture.is-peek {
        transform: translateX(0);
        top: 33.33vh;
        left: calc(75vw + 1rem);
        width: calc(75vw - 1rem);
        height: 100vh;
    }

    .science-gallery-controls {
        position: absolute;
        z-index: 2;
        bottom: calc(66.66vh + 2rem);
        right: 2rem;
        display: flex;
        gap: 2rem;
        align-items: center;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
    }

    .science-gallery.has-peek .science-gallery-controls {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Section: Products */
.products {

}

.products-intro {
    text-align: center;
    padding: 1rem;
    margin: 4rem auto 1rem;
    max-width: 1024px;
    font-size: var(--text-p1);
    line-height: 130%;
    text-align: left;
}

.products-pin {
    position: relative;
    width: 100%;
    margin-bottom: 5rem;
}

.products-track {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100svh;
    overflow: hidden;
    margin-bottom: 4rem;
}

.products-list {
    display: flex;
    width: max-content;
    height: 100%;
    gap: 2rem;
    will-change: transform;
    padding-right: 5vw;
}

@media screen and (min-width: 768px) {
    .products-list {
        gap: 4rem;
    }

    .products-intro {
        font-size: var(--text-h3);
        text-align: center;
        padding: 1rem;
        margin: 8rem auto 1rem;
    }

    .products-pin {
        margin-bottom: 25vh;
    }
}

/* Product */
.product {
    position: relative;
    min-width: 90vw;
    width: 90vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* height: 80svh; */
    padding-bottom: 3rem;
    transition: min-width 1s ease, width 1s ease;
}

.product:first-child {
    min-width: 100vw;
    width: 100vw;
}

.products-list.is-shrunk .product:first-child {
    min-width: 90vw;
    width: 90vw;
}

.product-cover {
    position: relative;
    height: 80vh;
    width: 100%;
    overflow: hidden;
    flex-grow: 1;
}

.product-image,
.product-packaging {
    transform: translateX(4rem);
    transition:
        transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0ms),
        opacity 900ms ease var(--reveal-delay, 0ms);
}

.product-image.is-revealed,
.product-packaging.is-revealed {
    transform: translateX(0);
}

.product-packaging {
    --reveal-delay: 200ms;
}

.product-image {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    z-index: 1;
    height: 65vh;
    width: auto;
}

.product.two-images .product-image {
    translate: -25% -40%;
    filter: drop-shadow(0px 0px 24px rgba(0, 0, 0, 0.25));
}

.product-packaging {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    height: 70vh;
    scale: 1;
    width: auto;
}

.product.two-images .product-packaging {
    translate: -75% -50%;
}

.product-packaging.landscape {
    width: 100%;
    height: auto;
}

.product-image-img,
.product-packaging-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-title {
    text-align: center;
    font-size: var(--text-p2);
    text-transform: uppercase;
}

.product-line {
    width: 1px;
    height: 1rem;
    background-color: var(--color-green);

    position: absolute;
    bottom: 0;
    left: 50%;

}

@media screen and (min-width: 768px) {
    .product {
        min-width: 50vw;
        width: 50vw;
        /* height: 50vw; */
    }

    .product:first-child {
        min-width: 100vw;
        width: 100vw;
    }

    .products-list.is-shrunk .product:first-child {
        min-width: 50vw;
        width: 50vw;
    }
}

@media screen and (min-width: 1024px) {
    .product {
        min-width: 30vw;
        width: 30vw;
        /* height: 35vw; */
    }

    .product:first-child {
        min-width: 100vw;
        width: 100vw;
    }

    .product:first-child .product-cover {
        min-width: 30vw;
        width: 30vw;
    }

    .products-list.is-shrunk .product:first-child {
        min-width: 30vw;
        width: 30vw;
    }
}


/* Section: About */
.about {
    margin-bottom: 3.5rem;
    background-color: var(--color-blue);
}

.about .layout {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.about .column {
    width: 100%;
}

.about .layout:nth-child(2) .column:nth-child(2) {
    order: 1;
}

.about .layout:nth-child(2) .column:nth-child(1) {
    order: 2;
}

.about img {
    width: 100%;
}

.about blockquote {
    margin: 0;
    padding: 1.5rem;
    margin-bottom: 4rem;
}

.about blockquote p {
    font-size: var(--text-h1);
}

@media screen and (min-width: 768px) {
    .about {
        /* padding: 4rem 2rem; */
    }

    .about .layout {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        gap: 0;
        
    }

    .about .column {
        grid-column: span calc(var(--width) * 12);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .about .layout:nth-child(2) .column:nth-child(2) {
        order: unset;
    }

    .about .layout:nth-child(2) .column:nth-child(1) {
        order: unset;
    }

    .about blockquote {
        margin: 0;
    }

    .about figure,
    .about img {
        width: 100%;
        height: 100svh;
        object-fit: cover;
    }

    .about .column .block-text {
        padding: 2rem;
    }
}

/* Section: Contact */
.contact {
    position: relative;
    padding: 1.5rem;
    transition: 0.6s;
    /* overflow: hidden; */
}

.contact-title {
    font-size: var(--text-h2);
    z-index: 1;
}

.contact-form {
    z-index: 1;
}

.contact-form label {
    display: block;
    margin: 3rem 0;
    width: 100%;
    position: relative;
}

.contact-form label span {
    display: block;
    width: 100%;
    position: absolute;
    bottom: 50%;
    opacity: 0.5;
    transition: 300ms;
    font-size: var(--text-p1);
}

.contact-form label:focus-visible span,
.contact-form label:focus-within span {
    bottom: calc(100% + 0.5rem);
    opacity: 1;
}

.contact-form input {
    display: block;
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid white;
    padding: 0.25rem 0;
    font-size: var(--text-p1);
}



@media screen and (min-width: 768px) { 
    .contact {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: 1fr 4fr;
        padding: 8rem 1rem;
    }

    .contact-title,
    .contact-success,
    .contact-alert {
        grid-column: 3/-3;
    }

    .contact-title {
        text-align: center;
    }

    .contact-form {
        grid-column: 4/-4;
    }
}

/* Page: Default */

.page-default {
    min-height: 100svh;
    padding: 8rem 0;
}

.page-default-title {
    text-align: center;
    padding: 1.5rem;
}

.page-default-content {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
}

.block-text {
    padding: 1.5rem;
    grid-column: 1/-1;
    font-size: var(--text-p1);
    line-height: 1.4;
}

.block-text p {
    margin-bottom: 1em;
}

.block-heading {
    padding: 0 1.5rem;
    margin: 3rem 0;
    grid-column: 1/-1;
    text-align: center;
    font-size: var(--text-h3);
}

.block-table {
    grid-column: 1/-1;
    margin: 3rem 0;
    padding: 1.5rem;
}

@media screen and (min-width: 768px) {
    .block-text {
        grid-column: 2/-2;
        padding: 0;
    }

    .block-heading {
        grid-column: 2/-2;
        padding: 0;
    }

    .block-table {
        grid-column: 1/-1;
    }
}

@media screen and (min-width: 1024px) {
    .block-text {
        grid-column: 3/-3;
    }
    
    .block-heading {
        grid-column: 3/-3;
    }

    .block-table {
        grid-column: 2/-2;
        padding: 0;
    }
}


/* 
    Components 
*/

/* Components: Tag */
.tag {
    background-color: var(--color-green);
    padding: 0.25rem 0.5rem;
    color: black;
}

/* Components: Button */
.button {
    padding: 0.75rem;
    position: relative;
    text-transform: uppercase;
    color: var(--color-green);
    font-size: var(--text-btn1);
    text-decoration: none;
}

.button.disabled,
.button:disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.button::before {
    content: url("../img/medesthe-corner-top-right.svg");
    position: absolute;
    top: 0;
    right: 0;
}

.button::after {
    content: url("../img/medesthe-corner-bottom-left.svg");
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Components: Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table tr {
    width: 100%;
}


.table td,
.table th {
    padding: 1.5rem 0;
    border-bottom: 1px solid white;
}