* {
    box-sizing: border-box;
}

html,
body {
    background-color: #151422;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    --color-white: #FFFFFF;
    --color-primary-100: #C6ECF4;
    --color-primary-200: #68D2F4;
    --color-primary-300: #4EC2E7;
    --color-primary-400: #097EA4;
    --color-primary-500: #194553;
    --color-black: #151422;
    --color-green: #17C466;
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, Roboto, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

ol,
ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1rem;
}

li {
    display: grid;
    grid-template-columns: 0 1fr;
    gap: 1.75em;
    align-items: start;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 500;
}

ul li::before {
    content: attr(data-icon);
    /* Make slightly larger than the li font-size
    but smaller than the li gap */
    font-size: 1em;
}

p {
    line-height: 1.5;
    letter-spacing: 0.01em;
}

.scroll-watcher {
    height: 3px;
    position: fixed;
    top: 0;
    z-index: 10001;
    background-color: var(--color-primary-200);
    width: 100%;
    scale: 0 1;
    transform-origin: left;
    animation: scroll-watcher linear;
    animation-timeline: scroll();
}

@keyframes scroll-watcher {
    to {
        scale: 1 1;
    }
}

.top-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    animation: bg-shift linear;
    animation-timeline: scroll();
}

@keyframes bg-shift {
    0% {
        background-color: rgba(21, 20, 34, 0);
    }

    10% {
        background-color: rgba(21, 20, 34, 0);
    }

    15% {
        background-color: rgba(21, 20, 34, 0.8);
    }

    100% {
        background-color: rgba(21, 20, 34, 0.8);
    }
}

.top-bar::after {
    content: "";
    display: block;
    position: absolute;
    height: 1px;
    bottom: 0;
    left: 2.5rem;
    right: 2.5rem;
    background: var(--color-primary-400);
}

.top-bar-logo {
    height: 40px;
    width: auto;
}

.hero-element {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    max-height: 900px;
    min-height: 600px;
    position: relative;
    color: var(--color-primary-100);
    background-image: url("../images/hero-image2.jpg");
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

@media (max-width: 768px) {
    .hero-element {
        background-attachment: scroll;
        min-height: 100vh;
        max-height: none;
    }
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 2rem;
}

.hero-logo-badge {
    width: 15vw;
    max-width: 7rem;
    height: auto;
}

.hero-arrow {
    height: 40px;
    width: auto;
}

.hero-text {
    font-size: clamp(1.125rem, 2.5vw + 0.5rem, 1.5rem);
    line-height: 150%;
    font-weight: 400;
    text-align: center;
    width: 90%;
    max-width: 900px;
    padding: 0 1rem;
}

.hero-highlight-text {
    color: var(--color-primary-300);
    font-weight: 600;
    line-height: 150%;
}

.hero-element:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 80px;
    bottom: 0;
    left: 0;
    right: 0;
    background-image: url("../images/triangle-color-1.svg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10001;
    width: 32px;
    height: 32px;
    position: relative;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--color-primary-300);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    transform-origin: center;
    display: block;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-items {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-items li {
    display: list-item;
    margin: 0;
    padding: 0;
    grid-template-columns: none;
    gap: 0;
}

.nav-items a {
    display: flex;
    padding: .5rem .75rem;
    font-size: clamp(0.875rem, 1vw, 1rem);
    font-weight: 500;
    color: var(--color-primary-300);
    text-decoration: none;
    white-space: nowrap;
}

.nav-items a:hover,
.nav-items a:focus {
    background: rgba(0, 0, 0, .2);
    color: var(--color-primary-100);
}

#palvelut {
    background-color: var(--color-primary-400);
    padding: clamp(2rem, 5vw, 5rem) clamp(1.5rem, 5vw, 5rem);
    color: var(--color-primary-100);
}

#palvelut h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 2rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: clamp(1rem, 2vw, 2rem);
    max-width: 1400px;
    margin: 0 auto;
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.service-icon {
    width: clamp(64px, 8vw, 96px);
    height: clamp(64px, 8vw, 96px);
    margin: clamp(1rem, 2vw, 1.5rem);
}

.service-card h3 {
    margin: 0;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    padding: 0 0.5rem;
}

.service-card p {
    line-height: 1.5;
    font-size: clamp(0.875rem, 1vw, 1rem);
    padding: 0 0.5rem;
}

#ota-yhteytta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--color-black);
    padding: clamp(6rem, 12vw, 11rem) clamp(1.5rem, 4vw, 4rem);
    color: var(--color-primary-100);
    position: relative;
    gap: 2rem;
}

#ota-yhteytta h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.contact-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(2rem, 6vw, 6rem);
    flex-wrap: wrap;
    width: 100%;
}

.contact-block {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    text-align: center;
}

.contact-block span {
    font-size: clamp(0.875rem, 1.2vw, 1rem);
    opacity: 0.9;
}

.contact-block h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.contact-divider {
    width: 1px;
    height: 3rem;
    background-color: var(--color-primary-300);
}

.contact-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-link:hover,
.contact-link:focus {
    color: var(--color-primary-200);
    text-decoration: underline;
}

#ota-yhteytta:before {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 80px;
    top: 0;
    left: 0;
    right: 0;
    background-image: url("../images/triangle-color-2.svg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

#ota-yhteytta:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 80px;
    bottom: 0;
    left: 0;
    right: 0;
    background-image: url("../images/triangle-white-1.svg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

#osaaminen,
#taloyhtiot {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    background-color: var(--color-primary-100);
    padding: clamp(2rem, 5vw, 4rem);
    color: var(--color-black);
}

#osaaminen h2,
#taloyhtiot h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

#osaaminen p,
#taloyhtiot p {
    font-size: clamp(1rem, 1.2vw, 1.125rem);
}

.section-image {
    flex: 1;
    max-width: 40vw;
    min-width: 280px;
    object-fit: cover;
    border-radius: 8px;
    height: auto;
    max-height: 500px;
}

.section-content {
    flex: 1;
    max-width: 40vw;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#asiantuntija {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(2rem, 4vw, 4rem);
    background-color: var(--color-black);
    padding: clamp(6rem, 12vw, 11rem) clamp(1.5rem, 4vw, 4rem) clamp(2rem, 4vw, 4rem);
    color: var(--color-primary-100);
    position: relative;
}

#asiantuntija h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin: 0;
    line-height: 150%;
}

#asiantuntija h4 {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    margin: 0;
    line-height: 150%;
}

#asiantuntija h5 {
    margin: 0;
    line-height: 150%;
}

#asiantuntija p {
    font-size: clamp(1rem, 1.2vw, 1.125rem);
}

#asiantuntija:before {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 80px;
    top: 0;
    left: 0;
    right: 0;
    background-image: url("../images/triangle-white-2.svg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.profile-image {
    border-radius: 50%;
    width: clamp(200px, 33.33%, 400px);
    max-width: 400px;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-contact {
    margin-top: 1rem;
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.profile-contact-slot {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.profile-contact-slot h5,
.profile-contact-slot p {
    margin: 0;
}

.profile-contact-divider {
    width: 1px;
    background-color: var(--color-primary-300);
    align-self: stretch;
}

footer {
    color: var(--color-primary-100);
    padding: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 4vw, 4rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-black);
    flex-wrap: wrap;
    gap: 1rem;
}

footer h3 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

footer div {
    text-align: right;
    font-size: clamp(0.875rem, 1vw, 1rem);
}

@media only screen and (max-width: 768px) {
    footer div {
        text-align: left;
    }
}


/* Utils */
.margin-0 {
    margin: 0;
}

.color-primary-300 {
    color: var(--color-primary-300);
}


@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        scale: .9;
        opacity: 0;
        animation: fade-in linear forwards;
        animation-timeline: view();
        animation-range: entry 150px;
    }

    .fade-out {
        scale: 1;
        opacity: 1;
        animation: fade-out linear;
        animation-timeline: view();
        animation-range: exit;
    }

    @keyframes fade-in {
        to {
            scale: 1;
            opacity: 1;
        }
    }

    @keyframes fade-out {
        to {
            scale: 0.9;
            opacity: 0;
        }
    }
}

@media only screen and (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }

    .section-content {
        max-width: 45%;
    }

    .section-image {
        max-width: 45%;
    }

    .contact-wrapper {
        gap: 3rem;
    }
}

@media only screen and (max-width: 900px) {
    .top-bar {
        padding: 1rem 1.5rem;
    }

    .nav-items a {
        font-size: 0.875rem;
        padding: .5rem;
    }

    .hero-text {
        width: 95%;
    }

    .section-content,
    .section-image {
        max-width: 48%;
        min-width: 250px;
    }
}

@media only screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .top-bar {
        padding: 1rem;
        flex-wrap: wrap;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    .nav-items {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: rgba(21, 20, 34, 0.95);
        backdrop-filter: blur(10px);
        padding: 0;
        margin: 0;
        width: 100%;
        gap: 0;
        border-top: 1px solid var(--color-primary-400);
        list-style: none;
        box-sizing: border-box;
    }

    .nav-items[aria-hidden="false"] {
        display: flex;
    }

    .nav-items[aria-hidden="true"] {
        display: none;
    }

    .nav-items li {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
        box-sizing: border-box;
        grid-template-columns: none;
        gap: 0;
    }

    .nav-items li::before {
        content: none;
    }

    .nav-items a {
        display: flex;
        padding: 1rem 1.5rem;
        margin: 0;
        font-size: 1rem;
        font-weight: 500;
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .top-bar::after {
        left: 1rem;
        right: 1rem;
    }

    .top-bar-logo {
        height: 32px;
    }

    .hero-logo-badge {
        width: 25vw;
        max-width: 6rem;
        min-width: 80px;
    }

    .hero-content {
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .hero-text {
        width: 100%;
        padding: 0;
    }

    .hero-arrow {
        height: 32px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .service-card {
        max-width: 400px;
        margin: 0 auto;
    }

    #ota-yhteytta {
        padding: 6rem 1.5rem;
    }

    .contact-wrapper {
        flex-direction: column;
        gap: 2rem;
        width: 100%;
    }

    .contact-divider {
        display: none;
    }

    #palvelut {
        padding: 3rem 1.5rem;
    }

    #osaaminen {
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }

    #taloyhtiot {
        flex-direction: column-reverse;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }

    .section-image {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        margin: 0 auto;
        max-height: 400px;
    }

    .section-content {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }

    #asiantuntija {
        flex-direction: column;
        gap: 2rem;
    }

    .profile-image {
        width: 70%;
        max-width: 300px;
    }

    .profile-contact {
        flex-direction: column;
        gap: 1.5rem;
    }

    .profile-contact-divider {
        display: none;
    }

    footer {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    footer div {
        text-align: center;
    }
}

@media only screen and (max-width: 480px) {
    .top-bar {
        padding: 0.75rem 1rem;
    }

    .top-bar-logo {
        height: 28px;
    }

    .hero-logo-badge {
        width: 30vw;
        min-width: 60px;
    }

    .hero-text {
        font-size: 1rem;
        line-height: 1.4;
    }

    .hero-content {
        gap: 1rem;
    }

    #palvelut {
        padding: 2rem 1rem;
    }

    .service-icon {
        width: 64px;
        height: 64px;
        margin: 1rem;
    }

    #ota-yhteytta {
        padding: 5rem 1rem;
    }

    #osaaminen,
    #taloyhtiot {
        padding: 1.5rem 1rem;
    }

    .section-image {
        max-height: 300px;
    }

    #asiantuntija {
        padding: 5rem 1rem 2rem;
    }

    .profile-image {
        width: 60%;
        max-width: 250px;
    }

    footer {
        padding: 3rem 1rem;
    }
}

/* Skip to main content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary-300);
    color: var(--color-black);
    padding: 8px;
    text-decoration: none;
    z-index: 10002;
}

.skip-link:focus {
    top: 0;
}