:root {
    --bg-light: #d9cbc9;
    --bg-shade: #c2aca8;
    --bg-dark: #63433f;
    --text-dark: #000;
    --text-darkblue: #0b0d45;
    --text-muted: #888;
    --text-light: #fff;
    --card-padding: 1.2rem;
    --logo-stroke: #a04200;
    --box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

html, body {
    font-family: 'Noto Sans', sans-serif;
    font-size: 12pt;
    max-width: 100%;
}

h2 {
    font-size: 1rem;
    font-weight: normal;
    margin: 0;
}
p {
    margin-block-start: 0;
    margin-block-end: 0.4rem;
}

body {
    background: white;
	max-width: 900px;
	margin: 0 auto;
}

.bg-container {
    position: fixed;
    inset: 0;
    background: url('background.jpg');
    background-size: cover;
    background-position: top left;
    z-index: -1;

    & .leaf-container {
        position: absolute;

        & .leaf {
            position: absolute;
            width: 20px;
            height: 20px;
            opacity: 0.0;
        }
    }
}

a, a:visited {
    color: var(--text-darkblue);
    text-decoration: underline;
}

@keyframes leaf-anim {
    0% {
        offset-distance: 0%;
        offset-rotate: -30deg;
        opacity: 0.0;
        transform: rotateX(30deg) rotateY(-20deg);
    }
    15%, 90% {
        opacity: 1.0;
    }
    100% {
        offset-distance: 100%;
        opacity: 0.0;
        offset-rotate: 60deg;
        transform: rotateX(-50deg) rotateY(50deg);
    }
}

.page {
	display: grid;
	grid-template-columns: 1px 1fr;

    & .leaf-verse-glider {
        width: 1px;
    }
}

.shadow {
    box-shadow: var(--box-shadow);
}

svg.logo {
    fill: none;
    stroke: var(--logo-stroke);
    stroke-dasharray: 0 100;
    stroke-width: 3px;
    stroke-linejoin: round;
    stroke-linecap: round;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.5, 0.0, 0.5, 1);
    animation-duration: 4s;
}
@keyframes logo-write {
    0% {
        stroke-dasharray: 0 100;
        stroke-dashoffset: -50;
    }
    100% {
        stroke-dasharray: 100 0;
        stroke-dashoffset: 0;
    }
}

header {
    margin-top: 50px;

    & .header-img {
        background: url(header.jpg);
        background-size: cover;
        background-position: center;
        height: 200px;
        animation: fade-in 2500ms;
        animation-delay: 800ms;
        animation-fill-mode: both;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 15px 15px 0 0;
    }

    & .quote {
        text-align: center;
        padding: 10px;
        border-radius: 10px;
        backdrop-filter: blur(5px) brightness(80%);
        color: white;
        animation: fade-in 2500ms;
        animation-delay: 2000ms;
        animation-fill-mode: both;

        & .text {
            font-family: 'Birthstone';
            font-size: 24pt;
            margin-bottom: 0.2rem;
            animation: scale-fade-in 3000ms;
            animation-delay: 2200ms;
            animation-fill-mode: both;
        }

        & .author {
            font-size: 12pt;
            font-weight: 300;
            animation: scale-fade-in 4000ms forwards;
            animation-fill-mode: both;
            animation-delay: 2500ms;
        }
    }
}

@keyframes scale-fade-in {
    0% {
        opacity: 0.0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1.0;
        transform: none;
    }
}

.header-bar {
    display: grid;
    position: relative;
    align-items: center;
    color: var(--text-darkblue);
    z-index: 5;

    & * {
        z-index: 5;
    }

    &::before {
        content: '';
        z-index: 1;
        background: var(--bg-light);
        border-radius: 0 0 15px 15px;
        box-shadow: var(--box-shadow);
        position: absolute;
        height: 100%;
        width: 100%;
        left: 50%;
        transform: translateX(-50%);
        animation: header-bar-in 1600ms forwards ease-out;
        animation-timing-function: cubic-bezier(0, 0, 0, 1);
    }

    & .header-logo {
        margin: 10px;
        display: flex;
        flex-direction: row;
        gap: 15px;
        animation: fade-in 2000ms;
        animation-delay: 1500ms;
        animation-fill-mode: both;

        & svg {
            animation-name: logo-write;
            animation-delay: 1000ms;
            animation-duration: 4000ms;
        }

        & .logo-text {
            & :nth-child(1) {
                font-size: 16pt;
            }

            & :nth-child(2) {
                font-size: 28pt;
                font-weight: 900;
            }
        }
    }

    & .profile-img {
        aspect-ratio: 1;
        width: 160px;
        background: url('henri en dineke.jpg');
        background-position: center;
        background-size: cover;
        border-radius: 100%;
        border: 2px var(--bg-dark) solid;
        box-shadow: 0 0 16px 3px #0000004f;
        animation: profile-img-in 1500ms forwards;
    }

    & .tel {
        grid-column: 3;
        animation: fade-in 2000ms;
        animation-delay: 1500ms;
        animation-fill-mode: both;

        & .number {
            text-decoration: none;
            color: inherit;
            font-weight: 600;
            font-size: 20pt;
        }

        & p {
            font-size: 10pt;
        }
    }
}

@keyframes header-bar-in {
    0% { width: 0%; opacity: 0.0; }
    100% { width: 100%; opacity: 1.0; }
}


@keyframes profile-img-in {
    0% {
        opacity: 0.0;
        transform: scale(0.8);
        box-shadow: 0 0 0 0 #0000004f;
    }
    100% {
        opacity: 1.0;
        transform: scale(1.0);
        box-shadow: 0 0 16px 3px #0000004f;
    }
}

@keyframes fade-in {
    0% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

@media screen and (min-width: 850px) {
    header, .textbox {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    header {
        margin-top: 80px;
        margin-bottom: 200px;
    }
    header .header-bar {
        grid-template-columns: 1fr 160px 1fr;
        justify-items: center;
        gap: 1rem;
    }
    header .header-bar .profile-img {
        position: absolute;
        left: 50%;
        translate: -50% 0;
    }
    .cards {
        column-count: 2;
        margin-bottom: 150px;
    }
    .widecols {
        display: flex;
        flex-direction: row;
        gap: 3rem;
        align-items: center;
    }
    #leaf-verse-anchor {
        position: sticky;
        top: 12%;
    }
    #leaf-verse-placeholder {
        displaý: block;
    }
    #leaf-verse-small {
        display: none;
    }
}
@media screen and (max-width: 850px) {
    header {
        margin-top: 0;
    }
    header .header-img {
        border-radius: 0;
    }
    header .quote {
        border-radius: 0;
    }
    header .header-bar {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 20px;
        padding-bottom: 100px;
        margin-bottom: 170px;

        & .header-logo {
            justify-content: center;
        }

        & .profile-img {
            grid-column: 1;
            grid-row: 3;
            position: absolute;
            top: 20px;
            left: 50%;
            translate: -50% 0;
        }

        & .tel {
            grid-column: 1;
            grid-row: 2;
            text-align: center;
        }
    }
    #leaf-verse {
        display: none;
    }
    #leaf-verse-placeholder {
        display: none;
    }
    .cards {
        column-count: 1;
    }
    .textbox {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    .widecols {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        align-items: center;
    }
}

.pretext {
    margin: 120px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 100px;
}

.textbox {
    min-width: 310px;
    background: var(--bg-light);
    border-radius: 15px;
    padding: var(--card-padding);
    box-sizing: border-box;
    z-index: 5;

    & .title {
        font-size: 120%;
        font-weight: 700;
        margin-bottom: 0.75rem;
    }
}

#leaf-verse-placeholder {
	margin-bottom: 200px;
}
#leaf-verse-anchor {
	display: block;
}
#leaf-verse {
    position: absolute;
    width: 600px;

    & .leaf {
        width: 100%;
    }
}
#leaf-verse-small {
    position: relative;
    margin-bottom: 150px;
    max-width: 100vw;
    overflow: hidden;

    & .leaf {
        width: 600px;
    }
}
#leaf-verse,
#leaf-verse-small {
    & .leaf {
        z-index: 0;
        filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
        position: relative;
        left: 50%;
        translate: -50% 0;
    }
    & .verse-container {
        position: absolute;
        top: 8%;
        left: 20%;
        right: 20%;
        bottom: 10%;
        z-index: 10;
        display: flex;
        justify-content: center;
    }

    & .gedicht {
        color: var(--text-light);
        text-wrap: nowrap;

        & .verse {
            line-height: 1.75;
        }

        & .author {
            font-size: 10pt;
            font-weight: 300;
            margin-top: 1.2rem;
        }
    }
}

@keyframes leaf-verse-left {
    0%, 100% { rotate: 0deg; }
    30% { rotate: 12deg; }
}
@keyframes leaf-verse-right {
    0%, 100% { rotate: 0deg; }
    30% { rotate: -12deg; }
}

@keyframes leaf {
    0% {
        top: 60%;
        opacity: 0.0;
        transform: rotateX(-10deg) rotateY(-15deg) rotateZ(-30deg) scale(0.3);
    }
    25% {
        opacity: 1.0;
    }
    60% {
        transform: rotateX(25deg) rotateY(40deg) rotateZ(40deg) scale(1.0);
    }
    100% {
        top: 200%;
        opacity: 0.0;
        transform: rotateX(-25deg) rotateY(-20deg) rotateZ(-10deg) scale(0.5);
    }
}

.cards .card {
    min-width: 310px;
    position: relative;
    margin: 0 30px 100px 30px;
    filter: drop-shadow(var(--drop-shadow));
    break-inside: avoid;

    & .title {
        position: relative;
        z-index: 10;

        &::before {
            content: '';
            position: absolute;
            width: 290px;
            z-index: 10;
            aspect-ratio: 312 / 101;
            background: url(./graphics/leaf-title-bg-left-opt.svg);
            background-repeat: no-repeat;
            background-size: contain;
        }

        & .text {
            z-index: 11;
            position: absolute;
            top: 20px;
            width: 190px;
            height: 60px;
            color: var(--text-light);
            font-weight: 800;
            font-size: 1.3rem;
        }
    }

    &:nth-child(odd) {
        & .title {
            &::before {
                right: -8px;
            }

            & .text {
                right: 40px;
                text-align: right;
            }
        }

        & .body {
            clip-path: polygon(-20px -20px, 80% -20px, calc(100% + 20px) 50px, calc(100% + 20px) calc(100% + 20px), -20px calc(100% + 20px));
        }
    }

    &.force-left-leaf,
    &:nth-child(even) {
        & .title {
            &::before {
                left: -8px;
                transform: scale(-1, 1);
            }

            & .text {
                left: 40px;
                text-align: left;
            }
        }

        & .body {
            clip-path: polygon(-20px 50px, 20% -20px, calc(100% + 20px) -20px, calc(100% + 20px) calc(100% + 20px), -20px calc(100% + 20px));
        }
    }

    & .body {
        position: relative;
        top: 24px;
        background: var(--bg-light);
        border-radius: 25px;
        padding: var(--card-padding);
        z-index: 5;
        padding-top: 85px;
        overflow: hidden;
        filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));

        & p:not(:last-child) {
            margin-block-start: 0;
            margin-block-end: 1.5rem;
        }

        & .img {
            border-radius: 10px;
            margin-bottom: 1.2rem;
            overflow: hidden;

            & img {
                width: 100%;
            }
        }
    }
}

.cards.bottom-closing {
    display: grid;
    justify-content: center;
    align-items: center;

    & .card {
        max-width: 600px;
    }
}
