main{
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--nav-height) 24px 48px;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    text-align: center;
    align-items: center;
    justify-content: center;
}
main h1{
    font-size: var(--otsikko2-koko);
    text-transform: uppercase;
    max-width: min(1000px, calc(100% - 2 * clamp(150px, 20vw, 300px)));
    line-height: 1.08;
    z-index: 1;
}
main > p{
    max-width: 60ch;
    margin-top: 16px;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    z-index: 1;
}
main .button{
    z-index: 1;
    margin-top: 15px;
}

.about{
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    padding: clamp(32px, 4vw, 56px) 24px;
    background-color: var(--väri-main);
    margin-top: 20vh;
}
.about::before,
.about::after{
    content: "";
    position: absolute;
    z-index: 1;
    left: 0;
    width: 100%;
    height: 14px;
    background-color: var(--väri-main);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 14'%3E%3Cpath fill='white' d='M0 7 C8 7 8 1 16 1 S24 7 32 7 S40 13 48 13 S56 7 64 7 V14 H0 Z'/%3E%3C/svg%3E");
    -webkit-mask-repeat: repeat-x;
    -webkit-mask-size: 64px 14px;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 14'%3E%3Cpath fill='white' d='M0 7 C8 7 8 1 16 1 S24 7 32 7 S40 13 48 13 S56 7 64 7 V14 H0 Z'/%3E%3C/svg%3E");
    mask-repeat: repeat-x;
    mask-size: 64px 14px;
    pointer-events: none;
}
.about::before{
    top: -14px;
}
.about::after{
    bottom: -14px;
    transform: scaleY(-1);
}
.about h1{
    position: relative;
    z-index: 5;
    max-width: 900px;
    font-size: var(--väliotsikko-koko);
    line-height: 1.1;
}
.about .osioTunniste{
    position: relative;
    z-index: 5;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: .9rem;
}
.about > p:not(.osioTunniste){
    position: relative;
    z-index: 5;
    max-width: 60ch;
    margin-top: 20px;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.8;
}
.tyoprosessi{
    width: 100%;
    padding: clamp(72px, 10vw, 128px) 24px;
    scroll-margin-top: var(--nav-height);
}
.tyoprosessiSisalto{
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(40px, 8vw, 112px);
    width: min(100%, 1200px);
    margin: 0 auto;
}
.tyoprosessiTeksti{
    min-width: 0;
}
.osioTunniste{
    color: var(--väri-teksti-secondary);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .08em;
    line-height: 1.5;
    text-transform: uppercase;
}
.tyoprosessiTeksti > h1{
    margin-top: 12px;
    font-size: var(--väliotsikko-koko);
    line-height: 1.1;
}
.tyoprosessiJohdanto{
    margin-top: 16px;
    line-height: 1.7;
}
.tyovaiheetLista{
    display: grid;
    gap: 0;
    margin-top: 28px;
    list-style: none;
}
.tyovaiheetLista li{
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 0;
    border-top: 1px solid rgba(28, 28, 28, .14);
}
.tyovaiheNumero{
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    background: var(--väri-main);
    font-weight: 700;
}
.tyovaiheetLista h2{
    margin-bottom: 4px;
    font-size: 1.05rem;
}
.tyovaiheetLista p{
    color: var(--väri-teksti-secondary);
    font-size: .95rem;
    line-height: 1.6;
}
.tyoprosessiKuvat{
    position: relative;
    min-width: 0;
    min-height: clamp(360px, 48vw, 580px);
}
.tyoprosessiKuvat img{
    position: absolute;
    display: block;
    object-fit: cover;
    object-position: center;
}
.tyoprosessiPaa{
    top: 0;
    right: 0;
    width: 78%;
    height: 82%;
}
.tyoprosessiSivu{
    bottom: 0;
    left: 0;
    width: 52%;
    height: 42%;
    border: 8px solid var(--väri-body);
}

main .kuvat{
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(80vw, 1200px);
    height: min(80vh, 600px);
    transform: translate(-50%, -40%);
    pointer-events: none;
}
@media screen and (max-width:1100px) {
    main .kuvat{
        height: 520px;
    }
}
main .kuvat img{
    position: absolute;
    display: block;
    min-width: 0;
    object-fit: cover;
    object-position: center;
    margin: 0;
}
main .kuva1,
main .kuva3{
    width: clamp(120px, 16vw, 220px);
    height: clamp(190px, 30vw, 340px);
}
main .kuva1{
    top: 8%;
    left: 0;
}
main .kuva2{
    bottom: 0;
    left: 12%;
    width: clamp(110px, 14vw, 165px);
    height: clamp(125px, 18vw, 220px);
}
main .kuva3{
    top: 8%;
    right: 0;
}
main .kuva4{
    right: 12%;
    bottom: 0;
    width: clamp(150px, 22vw, 280px);
    height: clamp(95px, 13vw, 160px);
}


.tiimi{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: clamp(48px, 8vw, 96px) clamp(16px, 5vw, 64px);
    background: #f3f1e9;
}
.tiimiCont{
    width: min(100%, 1200px);
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.tiimiCont > h1{
    max-width: 760px;
    margin-top: 12px;
    font-size: var(--väliotsikko-koko);
    line-height: 1.1;
}
.tiimiCont > p:not(.osioTunniste){
    margin-top: 16px;
}
.tiimiCont > .osioTunniste{
    margin-top: 0;
}

.kortit{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 3vw, 32px);
    width: min(100%, 1000px);
    margin-top: clamp(32px, 5vw, 64px);
}
.kortti{
    min-width: 0;
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.5vw, 28px);
    border-radius: 20px;
    padding: clamp(14px, 2vw, 24px);
    border: 1px solid rgba(28, 28, 28, .08);
    background-color: var(--väri-body);
    box-shadow: 0 12px 32px rgba(28, 28, 28, .07);
    overflow: hidden;
}
.kortti .kuva{
    filter: brightness(1.1) contrast(1.2) saturate(1.2);
    flex: 0 0 38%;
    width: 38%;
    max-height: 260px;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center;
    border-radius: 14px;
}
.kortti .teksti{
    flex: 1;
    min-width: 0;
    padding: 8px 0;
    text-align: left;
    overflow-wrap: anywhere;
}
.kortti .teksti h2{
    margin-bottom: 12px;
    font-weight: 400;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
}
.kortti .teksti p{
    margin-top: 8px;
    font-size: clamp(.8rem, 1.3vw, 1rem);
    line-height: 1.6;
}
.kortti .teksti span{
    font-weight: bold;
}
.kortti .teksti a{
    color: inherit;
    text-decoration-color: var(--väri-main);
    text-underline-offset: 3px;
}
.kortti .teksti a:hover{
    text-decoration-thickness: 2px;
}


.referenssit{
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(72px, 10vw, 120px) 24px;
    text-align: center;
    scroll-margin-top: var(--nav-height);
    width: 100%;
}
.referenssit > h1{
    margin-top: 12px;
    font-size: var(--väliotsikko-koko);
}
.referenssit > p{
    margin-top: 12px;
    font-size: clamp(.95rem, 1.6vw, 1.1rem);
}
.referenssit > .osioTunniste{
    margin-top: 0;
    font-size: .9rem;
}
.referenssitCont{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: clamp(16px, 2.5vw, 28px);
    width: min(100%, 1100px);
    margin-top: clamp(24px, 4vw, 40px);
}
.referenssi{
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 20px;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    border: 1px solid rgba(28, 28, 28, .08);
    border-radius: 18px;
    background: #fff;
    color: inherit;
    font: inherit;
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 8px 24px rgba(28, 28, 28, .06);
    transition: box-shadow .25s ease, transform .2s ease;
}
.referenssi img{
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 12px;
    transition: transform .35s ease;
}
.referenssi span{
    padding: 2px 4px 4px;
    font-weight: 600;
    line-height: 1.4;
}
.referenssi:hover{
    box-shadow: 0 14px 32px rgba(28, 28, 28, .12);
    transform: translateY(-3px);
}
.referenssi:hover img{
    transform: scale(1.015);
}
.referenssi:focus-visible,
.referenssiTakaisin:focus-visible{
    outline: 3px solid var(--väri-teksti);
    outline-offset: 4px;
}
.referenssi .kuva{
    display: block;
    height: auto;
    width: 100%;
    background-position: center;
    background-size: cover;
    object-fit: cover;
}
.referenssiDialog{
    width: min(1000px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100% - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 20px;
    color: var(--väri-teksti);
    background: var(--väri-body);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.referenssiDialog::backdrop{
    background: rgba(0, 0, 0, .65);
}
.referenssiSisalto{
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(240px, .9fr);
    align-items: center;
    gap: 32px;
    padding: 32px;
}
.referenssiSlider{
    position: relative;
    min-width: 0;
}
.referenssiIsoKuva{
    display: block;
    width: 100%;
    max-height: 65vh;
    object-fit: cover;
}
.sliderNuoli{
    position: absolute;
    top: 50%;
    z-index: 1;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(28, 28, 28, .75);
    color: #fff;
    font: inherit;
    font-size: 22px;
    cursor: pointer;
}
.sliderNuoli:hover{
    background: var(--väri-teksti);
}
.sliderNuoli:focus-visible{
    outline: 3px solid var(--väri-main);
    outline-offset: 3px;
}
.sliderEdellinen{
    left: 12px;
}
.sliderSeuraava{
    right: 12px;
}
.sliderLaskuri{
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(28, 28, 28, .75);
    color: #fff;
    font-size: 14px;
}
.referenssiTeksti h2{
    margin-bottom: 16px;
}
.referenssiTeksti p{
    line-height: 1.7;
}
.referenssiTakaisin{
    margin-top: 24px;
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--väri-main);
    color: var(--väri-teksti);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.button{
    color: inherit;
    text-decoration: none;
}
.button:focus-visible{
    outline: 3px solid var(--väri-teksti);
    outline-offset: 4px;
    border-radius: 8px;
}

.arviopyynto{
    width: 100%;
    padding: clamp(64px, 9vw, 112px) 24px;
    background: #f3f1e9;
    scroll-margin-top: var(--nav-height);
}
.arviopyyntoSisalto{
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    align-items: start;
    gap: clamp(32px, 7vw, 88px);
    width: min(100%, 1120px);
    margin: 0 auto;
}
.arviopyyntoEsittely{
    position: sticky;
    top: calc(var(--nav-height) + 32px);
}
.arviopyyntoEsittely h1{
    margin-top: 12px;
    font-size: var(--väliotsikko-koko);
    line-height: 1.1;
}
.arviopyyntoEsittely > p:last-child{
    margin-top: 16px;
    color: var(--väri-teksti-secondary);
    line-height: 1.7;
}
.arvioLomake{
    min-width: 0;
    padding: clamp(20px, 4vw, 36px);
    border: 1px solid rgba(28, 28, 28, .08);
    border-radius: 20px;
    background: var(--väri-body);
    box-shadow: 0 12px 32px rgba(28, 28, 28, .07);
}
.arvioHoneypot{
    display: none;
}
.arvioKentat{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
}
.arvioKentta{
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    font-size: .95rem;
    font-weight: 600;
}
.arvioKenttaLevea{
    grid-column: 1 / -1;
}
.arvioKentta input,
.arvioKentta select,
.arvioKentta textarea{
    width: 100%;
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid rgba(28, 28, 28, .22);
    border-radius: 10px;
    background: #fff;
    color: var(--väri-teksti);
    font: inherit;
    font-size: 1rem;
}
.arvioKentta textarea{
    min-height: 140px;
    resize: vertical;
}
.arvioKentta input:focus,
.arvioKentta select:focus,
.arvioKentta textarea:focus{
    outline: 3px solid rgba(252, 198, 4, .45);
    border-color: var(--väri-teksti);
}
.arvioPakolliset{
    margin-top: 16px;
    color: var(--väri-teksti-secondary);
    font-size: .85rem;
}
.arvioTietosuoja{
    margin-top: 16px;
    color: var(--väri-teksti-secondary);
    font-size: .85rem;
    line-height: 1.6;
}
.arvioTietosuoja a{
    color: inherit;
    text-decoration-color: var(--väri-main);
    text-underline-offset: 3px;
}
.arvioTietosuoja a:hover{
    color: var(--väri-teksti);
}
.arvioLaheta{
    margin-top: 16px;
    padding: 14px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--väri-main);
    color: var(--väri-teksti);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter .2s ease, transform .2s ease;
}
.arvioLaheta:hover{
    filter: brightness(.95);
    transform: translateY(-1px);
}
.arvioLaheta:focus-visible{
    outline: 3px solid var(--väri-teksti);
    outline-offset: 3px;
}
.arvioLaheta:disabled{
    cursor: wait;
    opacity: .7;
}
.arvioLomakeIlmoitus{
    margin-top: 12px;
    font-size: .95rem;
    line-height: 1.5;
}
.arvioLomakeIlmoitus:empty{
    display: none;
}
.arvioLomakeIlmoitus[data-state="success"]{
    color: #176b36;
}
.arvioLomakeIlmoitus[data-state="error"]{
    color: #a12622;
}

.footer{
    width: 100%;
    padding: clamp(40px, 6vw, 64px) max(20px, 6vw);
    background: var(--väri-teksti);
    color: var(--väri-body);
}
.footerSisalto{
    display: flex;
    justify-content: space-between;
    gap: clamp(32px, 5vw, 72px);
    width: min(100%, 1200px);
    margin: 0 auto;
}
.footerEsittely,
.footerYhteystiedot{
    min-width: 0;
}
.footer h2{
    margin-bottom: 16px;
    color: var(--väri-main);
    font-size: 24px;
}
.footerEsittely p{
    max-width: 32ch;
    line-height: 1.7;
}
.footerHenkilot{
    display: flex;
    flex-wrap: wrap;
    gap: clamp(24px, 4vw, 48px);
}
.footer address{
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    font-style: normal;
}
.footerKuva{
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}
.footer address h3{
    margin-bottom: 4px;
    font-size: 18px;
}
.footer a{
    color: var(--väri-body);
    text-decoration-color: var(--väri-main);
    text-underline-offset: 4px;
    overflow-wrap: anywhere;
}
.footer a:hover{
    color: var(--väri-main);
}
@media (max-width: 650px){
    .referenssiSisalto{
        grid-template-columns: 1fr;
        gap: 20px;
        padding: clamp(16px, 5vw, 24px);
    }
    .referenssiIsoKuva{
        max-height: 40vh;
    }
    .about{
        margin: clamp(48px, 8vw, 88px) 0;
        padding: 24px;
    }
    .tyoprosessiSisalto{
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .tyoprosessiKuvat{
        min-height: clamp(280px, 78vw, 440px);
    }
    .tiimi{
        padding-inline: 16px;
    }
    .kortit{
        grid-template-columns: minmax(0, 420px);
        justify-content: center;
    }
    .kortti{
        gap: 16px;
    }
    .footerSisalto{
        flex-direction: column;
        gap: 28px;
    }
    .arviopyyntoSisalto{
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .arviopyyntoEsittely{
        position: static;
    }
    .kortti{
        max-width: 520px;
    }
}

@media (max-width: 380px){
    .arvioKentat{
        grid-template-columns: 1fr;
    }
    .arvioKenttaLevea{
        grid-column: auto;
    }
    .arvioLaheta{
        width: 100%;
    }
    .referenssiDialog{
        width: calc(100% - 16px);
        max-height: calc(100% - 16px);
    }
    .referenssiSisalto{
        padding: 12px;
    }
    .sliderNuoli{
        width: 38px;
        height: 38px;
    }
    .footerHenkilot{
        flex-direction: column;
        gap: 24px;
    }
    .kortti{
        gap: 12px;
    }
    .kortti .kuva{
        flex-basis: 34%;
        width: 34%;
    }
    .kortti .teksti{
        padding-block: 12px;
    }
}

@media (max-width: 760px), (max-height: 600px) and (max-width: 1000px){
    main{
        justify-content: flex-start;
        padding-top: calc(var(--nav-height) + 32px);
    }
    main h1{
        max-width: 100%;
    }
    main .kuvat{
        position: relative;
        top: auto;
        left: auto;
        display: grid;
        grid-template-columns: 1.05fr 1fr;
        grid-template-rows: clamp(100px, 32vw, 170px) clamp(90px, 29vw, 150px) auto;
        grid-template-areas:
            "feature upper"
            "feature lower"
            "wide wide";
        align-items: stretch;
        gap: clamp(10px, 3vw, 18px);
        width: min(100%, 500px);
        height: auto;
        margin-top: clamp(32px, 8vw, 56px);
        transform: none;
    }
    main .kuvat img{
        position: static;
        width: 100%;
        height: 100%;
    }
    main .kuva1{
        grid-area: feature;
    }
    main .kuva3{
        grid-area: upper;
    }
    main .kuva2{
        grid-area: lower;
    }
    main .kuva4{
        grid-area: wide;
        aspect-ratio: 2 / 1;
        height: auto;
    }
}
