* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
 
:root {
    --bg: #02060E;
    --text: #ffffff;
    --muted: #aeb7cc;
    --yellow: #f2c300;
    --line: rgba(255, 255, 255, 0.12);
    --card: rgba(19, 36, 77, 0.85);

    --space-xs: clamp(8px, 0.5vw, 10px);
    --space-sm: clamp(12px, 0.8vw, 16px);
    --space-md: clamp(18px, 1.2vw, 24px);
    --space-lg: clamp(24px, 2vw, 40px);
    --space-xl: clamp(32px, 3vw, 64px);
}

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    font-size: 18px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Lato", sans-serif;
    font-weight: 100;
    font-style: normal;
    min-height: 100svh;
    overflow-x: hidden;
    
}

.text-main {
    font-family: "darkmode-on", sans-serif;
    font-weight: 100;
    font-style: normal;
    color: var(--text);
}

.text-muted {
    font-family: "darkmode-on", sans-serif;
    font-weight: 100;
    font-style: normal;
    color: var(--muted);
}

.text-accent {
    font-family: "darkmode-on", sans-serif;
    font-weight: 200;
    font-style: normal;
    color: var(--yellow);
}

h1, h2, h3, a, p, span {
    font-style: normal;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: #5f8cff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page {
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    position: relative;
}

.container {
    width: min(1920px, calc(100% - 64px));
    margin: 0 auto;
}

.ylapalkki {
    position: relative;
    padding: clamp(14px, 1.4vh, 24px) 0;
}

.ylapalkki .container {
    padding-top: 5px;
}

.page::before {
    content: "";
    position: absolute;
    left: clamp(20px, 8vw, 140px);
    top: clamp(-120px, -7vw, -40px);
    width: clamp(520px, 58vw, 1150px);
    height: clamp(180px, 24vw, 460px);
    background: radial-gradient(
        ellipse at 18% 28%,
        rgba(40, 74, 180, 0.34) 0%,
        rgba(24, 50, 130, 0.28) 34%,
        rgba(12, 24, 70, 0.12) 58%,
        rgba(0, 0, 0, 0) 80%
    );
    filter: blur(clamp(14px, 2vw, 30px));
    transform: rotate(6deg);
    pointer-events: none;
    z-index: -1;
}

.logo {
    display: flex;
    align-items: center;
    gap: clamp(10px, 0.9vw, 16px);
    top: 0;
}

#k-logo {
    width: clamp(30px, 2.2vw, 46px);
}

#koodikon-logo {
    font-family: "darkmode-on", sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.2vw, 22px);
    /* letter-spacing: 0.14em; */
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    color: var(--text);
    margin-left: 1%;
    margin-top: 0.5%;
}

main {
    display: flex;
    align-items: stretch;
    padding: 0;
}

main .container {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100%;
    padding-top: clamp(8px, 1vh, 18px);
    padding-bottom: clamp(8px, 1vh, 18px);
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(28px, 2.5vw, 56px);
    align-items: center;
    justify-items: center;
    min-height: 0;
    padding: clamp(18px, 2vh, 36px) 0;
}

#otsikko {
    align-self: center;
    justify-self: center;
    max-width: 1000px;
}

.headline-wrap {
    position: relative;
    display: inline-block;
    width: fit-content;
}

.headline-wrap h1 {
    font-family: "Lato", sans-serif;
    font-weight: 100;
    font-style: normal;
    color: var(--text);
}

#otsikko h1 {
    font-size: clamp(3.2rem, 5vw, 6rem);
    line-height: 1.02;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.kaari {
    position: absolute;
    width: 50%;
    right: -2%;
    top: 0.9em;
    z-index: 3;
    pointer-events: none;
}

#otsikko p {
    font-size: clamp(1rem, 1.3vw, 1.8rem);
    line-height: 1.35;
    max-width: 100%;
    padding-top: 50px;
}

#iso-k {
    display: flex;
    justify-content: center;
    align-items: center;
    justify-self: center;
    min-height: 0;
    position: relative;
}

#iso-k::before {
    content: "";
    position: absolute;
    width: clamp(320px, 38vw, 450px);
    height: clamp(180px, 18vw, 320px);
    background: radial-gradient(
        ellipse at 30% 50%,
        rgba(38, 71, 170, 0.30) 0%,
        rgba(26, 52, 130, 0.18) 35%,
        rgba(16, 30, 84, 0.10) 55%,
        rgba(0, 0, 0, 0) 75%
    );
    filter: blur(28px);
    transform-origin: left center;
    transform: rotate(-24deg) scaleX(1.8) translate(-20px, 60px);
    z-index: 1;
    pointer-events: none;
}

#iso-k img {
    position: relative;
    z-index: 2;
    width: clamp(320px, 42vw, 900px);
    max-height: min(50vh, 760px);
    object-fit: contain;
    transform: scale(1.5);
}

.info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: clamp(30px, 6vw, 100px);
    align-items: start;
    justify-items: center;
    padding: clamp(8px, 1vh, 18px) 0 clamp(12px, 1.4vh, 24px);
}

#products,
#company,
#people,
#contact {
    width: 100%;
    text-align: left;
}

.info section h2 {
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.viiva {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--line);
    margin-bottom: clamp(12px, 1vh, 20px);
}

#yf {
    background: transparent linear-gradient(117deg, #B1B4D82E 0%, #1319462E 100%) 0% 0% no-repeat padding-box;
    position: relative;
    border: thin solid #ffffff38;
    border-radius: 19px;
    padding: clamp(14px, 1.2vw, 28px);
    min-height: clamp(130px, 16vh, 210px);
    margin-top: clamp(16px, 2vw, 30px);
    width: 100%;
    max-width: clamp(240px, 28vw, 420px);
}

#yf h3 {
    font-size: clamp(1.5rem, 1.8vw, 2rem);
    margin-bottom: 14px;
}

#yf p {
    line-height: 1.8;
    margin-bottom: 18px;
    font-size: clamp(0.92rem, 0.95vw, 1.1rem);
}

#yf a {
    display: block;
    width: fit-content;
    margin-top: clamp(12px, 1.2vw, 20px);
    margin-left: auto;
    font-size: clamp(1rem, 1vw, 1.2rem);
}

#yf-nappi i {
    margin-left: 10px;
}

#products p {
    width: auto;
    max-width: clamp(250px, 16vw, 280px);
    letter-spacing: 1px;
}

#company p,
#contact p,
#contact a,
.tyonimi {
    line-height: 2;
    font-size: clamp(0.9rem, 1vw, 1.5rem);
}

#company p {
    max-width: clamp(350px, 22vw, 340px);
}

.henkilo {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1vw, 16px);
    margin-bottom: clamp(14px, 1.2vh, 24px);
}

.henkilo-kuva {
    width: clamp(20px, 4vw, 100px);
    height: clamp(20px, 4vw, 100px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.henkilo-kuva.no-image{
    opacity: 0.2;
}
.henkilo-tekstit {
    min-width: 0;
}

.tyonimi {
    font-size: clamp(0.9rem, 0.95vw, 1.3rem);
    letter-spacing: 0.5px;
}

.nimi {
    font-size: clamp(1.2rem, 1.4vw, 1.6rem);
    font-weight: 400;
    margin-bottom: 2px;
}

.contact-item,
#contact-email {
    display: block;
    margin-bottom: clamp(8px, 0.8vh, 12px);
}

.alapalkki {
    padding: 0 0 clamp(12px, 1.2vh, 22px);
    position: relative;
}

.footer-viiva {
    margin-bottom: 14px;
}

#ala-logo {
    font-size: clamp(0.9rem, 0.95vw, 1rem);
}

@media (max-width: 1600px) {
    .container {
        width: min(1600px, calc(100% - 48px));
    }

    #iso-k img {
        width: min(100%, 480px);
        max-height: min(38vh, 360px);
    }
}

@media (max-width: 1280px) {

    .hero {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 28px;
        height: 100vh;
    }

    #otsikko {
        max-width: 100%;
        justify-self: center;
        text-align: center;
    }

    .headline-wrap {
        display: inline-block;
        margin: 0 auto;
    }

    #otsikko h1 {
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    #otsikko p {
        max-width: 32ch;
        margin-left: auto;
        margin-right: auto;
        padding-top: 5%;
    }

    #iso-k {
        justify-content: center;
        width: 100%;
        margin-top: -50px;
    }

    #iso-k img {
        margin: 0 auto;
        transform: scale(2.2);
    }

    .info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px 40px;
        justify-items: center;
        align-items: start;
    }

    #products,
    #company,
    #people,
    #contact {
        width: fit-content;
        max-width: 100%;
        max-width: 360px;
    }

    .logo {
        justify-content: flex-start;
        padding-left: 10px;
        margin-top: -30px;
    }

}

@media (max-width: 980px) {
    main .container {
        justify-items: center;
    }

    .ylapalkki .container {
        padding-top: 24px;
    }

    .logo {
        justify-content: flex-start;
        padding-left: 20px;
        padding-top: 30px;
    }

    #k-logo {
        width: 34px;
    }

    #koodikon-logo {
        font-size: 17px;
    }

    .hero {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 20px;
        padding: 12px 0 20px;
    }

    #otsikko {
        width: fit-content;
        margin-left: auto;
        margin-right: auto;

    }

    .headline-wrap {
        display: inline-block;
        margin: 0 auto;
    }

    #otsikko h1 {
        font-size: clamp(2.6rem, 9vw, 4rem);
        max-width: none;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        line-height: 1.02;
    }

    #otsikko p {
        max-width: 22ch;
        margin: 18px auto 0;
        padding-top: 0;
        text-align: center;
        font-size: clamp(0.95rem, 3.2vw, 1.2rem);
        line-height: 1.45;
    }

    #iso-k {
        justify-content: center;
        width: 100%;

    }

    #iso-k img {
        width: min(68%, 320px);
        margin: 0 auto;
        max-height: none;
    }

    .info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 25px 100px;
        padding-bottom: 20px;
        justify-items: center;
    }

    #products,
    #company,
    #people,
    #contact {
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }    
       .alapalkki {
        margin-left: 7%;
    }     
       
}

@media (max-width: 640px) {
    main .container {
        justify-items: center;
    }

    .container {
        width: min(100%, calc(100% - 28px));
    }

    .logo {
        padding-left: 4%;
        padding-top: 3%;
    }

    #k-logo {
        width: 30px;
        margin-left: -20%;
    }

    #koodikon-logo {
        font-size: 18px;
        margin-left: 10%;
        margin-top: 1%;
    }

    .hero {
        grid-template-columns: 1fr !important;
        justify-items: center;
        text-align: center;
        gap: 20px;
        width: 100%;
        margin: 0 auto;
    }

    #otsikko {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        text-align: center;
        height: 10em;
    }

    #otsikko h1 {
        font-size: clamp(2.2rem, 9vw, 3.2rem);
        line-height: 1.2em;
        max-width: none;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        margin-top: 15%;
    }

    #otsikko p {
        max-width: 20ch;
        margin: 14px auto 0;
        text-align: center;
        padding-top: 0;
        margin-top: 15%;
        font-size: 1.2em;
    }

    #iso-k {
        justify-content: center;
        width: 100%;
        margin-left: -5%;
    }

    #iso-k img {
        width: min(68%, 260px);
        margin: 0 auto;
        transform: scale(2.5);
    }

    .info {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 48px !important;
        justify-items: center;
        width: 100%;
        margin: 0 auto;
        margin-top: 20%;
    }
    .henkilo-tekstit {
        padding-left: 15px;
    }
    .henkilo-kuva{
        width: 3em;
        height: auto;
    }
    #products,
    #company,
    #people,
    #contact {
        width: 100%;
        max-width: 330px;
        margin-left: auto;
        margin-right: auto;
    }

    #yf {
        max-width: 100%;
    }
   .alapalkki {
        margin-left: 3.5%;
    }


}
@media (max-width: 352px) {

    .kaari {
        right: 28%;
        top: 1.8em;
    }
}