@import './fonts/kanit/kanit.css';

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg: oklch(0.971 0.0021 197);
    --primary: oklch(45.259% 0.06384 195.18);
    --accent: oklch(28.502% 0.00003 271.152);

    font-family: Kanit, sans-serif;
    color: var(--primary);
    background-color: var(--bg);
    line-height: 1.6;
}

/* dark mode */

@media (prefers-color-scheme: dark) {

    :root {
        --bg: oklch(0.178 0.0183 264.05);
        --primary: oklch(1 0.02 264.05);
    }

}

.container {
    max-width: 90rem;
    margin-inline: auto;
    padding-inline: 2rem;
}

body, figure {
    margin: 0;
}

p {
    max-width: 40em;
}

img {
    aspect-ratio: 8/5;
    width: 100%;
    display: block;
    object-fit: cover;
    height: auto;
}

/* HEADER */

header {
    padding-block: 1.5rem;
    border-block-end: 0.3rem solid var(--primary); /* Streepje tussen header en main */
    margin-block-end: 3rem;

    a {
        text-decoration: none;
        color: inherit;
    }

    .logo {
        font-variant: all-petite-caps;
        font-weight: bold;
        font-size: 2.2rem;
        letter-spacing: 0.05em;

        display: block;
        margin-block-end: 1rem;
    }

    nav {
        --link-h-padding: 1rem;

        ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        a {
            display: inline-block;
            padding: 0.5rem var(--link-h-padding);
            font-weight: bold;
            font-variant: all-petite-caps;
            letter-spacing: 0.08em;
            font-size: 1.1rem;
            position: relative;
            transition: color 0.2s ease;

            /* Strakke onderstreping in plaats van bolletjes */
            &::after {
                content: '';
                position: absolute;
                inset-inline: var(--link-h-padding);
                inset-block-end: 0.2rem;
                height: 0.25rem;
                background-color: var(--primary);
                transform: scaleX(0);
                transform-origin: left;
                transition: transform 0.25s ease-out;
            }

            &.active,
            &:focus-visible,
            &:hover {
                &::after {
                    transform: scaleX(1);
                }
            }
        }
    }
}

/* MAIN */

.hero {
    position: relative;

    h1 {
        font-size: clamp(2.5rem, 8vw, 7.5rem);
        font-variant: all-petite-caps;
        font-weight: 900;
        line-height: 0.85;
        letter-spacing: -0.02em;
        margin: 0;
        
        /* Strakke, moderne stijl met kader en subtiele 3D-schaduw */
        background-color: var(--bg);
        color: var(--primary);
        border: 0.3rem solid var(--primary);
        padding: 1rem 1.5rem;
        box-shadow: 0.6rem 0.6rem 0 var(--primary);

        position: absolute;
        inset-block-start: 50%;
        inset-inline-start: 1rem;
        transform: translateY(-50%);
        max-width: min-content;

        animation: floatTitle 4s ease-in-out infinite;
    }
}

section {
    margin-block: 5rem;
}

.row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.box-2 {
    flex: 1 1 14rem;
}

.box-3 {
    flex: 1 1 14rem;
}

.box {
    border: 0.3rem solid;
    padding: 1rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    h2, h3, h4 {
        margin-block: 0;
    }

    a {
        color: inherit;
    }
}

.box-1 {
    font-weight: bold;
}

.testimonials {

    padding-block-start: 8rem;
    position: relative;

    ol {
        list-style: none;
        padding: 0;
        margin: 0;

        figure {
            margin-block: 4rem;
        }
    }

    &::before,
    &::after {
        content: '';
        height: 0.3rem;
        background-color: var(--primary);
        display: block;
        width: 50%;
        margin-inline: auto;
    }

    &::before {
        position: absolute;
        inset-block-start: 0;
        inset-inline-start: 25%;
    }

    figure {
        border: 0.3rem solid;
        position: relative;
        inset-block-start: 0;
        inset-inline-end: 0;
        transition: inset .2s ease-in-out;

        &::after {
            background-color: var(--accent);
            content: '';
            width: 100%;
            height: 100%;
            display: block;
            position: absolute;
            inset-block-start: -1rem;
            inset-inline-end: -1rem;
            border: 0.3rem solid;
            z-index: -1;
            transition: inset .2s ease-in-out;
        }
    }

    li:hover {
        figure {

            inset-block-start: 0.5rem;
            inset-inline-end: 0.5rem;

            &::after {
                inset-block-start: -2rem;
                inset-inline-end: -2rem;
            }
        }
    }
}


/* FORM */

form {
    max-width: 40rem;

    .formfield {
        margin-block-end: 1rem;
    }

    label {
        font-variant: all-petite-caps;
        font-weight: bold;
        font-size: 0.8rem;
        letter-spacing: 0.1em;
        display: block;
    }

    input, textarea {
        border: 0.1rem solid var(--primary);
        width: 100%;
        min-height: 2em;
        border-radius: .2rem;
        background-color: var(--bg);
        color: var(--primary);
    }

    button {
        font: inherit;
        background: var(--bg);
        border: 0.2rem solid;
        color: inherit;
        font-variant: all-petite-caps;
        font-weight: bold;
        padding: 0.4em 1.8em;
        margin-block-start: 1em;
    }
}


/* FOOTER */

footer {
    border-block-start: 0.3rem solid;
}

@media (min-width: 40em) {

    /* het logo links, de nav rechts, zoals in het ontwerp */
    header  {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1em;
        flex-wrap: wrap;
    }

    header .logo {
        margin-block-end: 0;
    }

    header nav ul {
        flex-direction: row;
        flex-wrap: wrap;
    }

    /* en dan hoort het bolletje onder de link in plaats van ernaast */
    header nav a::before {
        inset-inline-start: calc(50% - .5rem);
        inset-block-start: auto;
        inset-block-end: -0.5rem;
    }

    /* de titel schuift naar de rechterkant, in de ruimte die de hero vrijhoudt */
    .hero {
        padding-inline-end: 12rem;

        h1 {
            inset-inline-start: unset;
            inset-inline-end: 0;
        }
    }

    .testimonials {
        li {
            display: flex;
            gap: 4rem;
            margin-block: 8rem;
            align-items: center;

            > * {
                flex: 0 1 30rem;
            }

            &:nth-child(odd) {
                flex-direction: row-reverse;
            }

            &:nth-child(even) {
                text-align: right;
            }
        }

        ol figure {
            margin-block: 0;
        }
    }

}

@media (prefers-reduced-motion: reduce) {

    .hero h1 {
        animation: none;
    }

    header nav a::before,
    .testimonials figure,
    .testimonials figure::after {
        transition: none;
    }

}

