@font-face {
    font-family: 'Open Sans';
    src: url('https://cdn.taurusnetwork.uk/static/fonts/OpenSans/OpenSans-Regular.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'Open Sans';
    src: url('https://cdn.taurusnetwork.uk/static/fonts/OpenSans/OpenSans-SemiBold.ttf') format('truetype');
    font-weight: bold;
}

@font-face {
    font-family: 'Open Sans';
    src: url('https://cdn.taurusnetwork.uk/static/fonts/OpenSans/OpenSans-Italic.ttf') format('truetype');
    font-style: italic;
}

@font-face {
    font-family: 'Sorts Mill Goudy';
    src: url('https://cdn.taurusnetwork.uk/static/fonts/SortsMillGoudy/SortsMillGoudy-Regular.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'Sorts Mill Goudy';
    src: url('https://cdn.taurusnetwork.uk/static/fonts/SortsMillGoudy/SortsMillGoudy-Italic.ttf') format('truetype');
    font-style: italic;
}

:root {
    --colour-background: #FCF7F1;
    --colour-primary: #003320;
    --colour-secondary: #E8EBD8;
    --colour-text-accent: #D4C155;
    --layout-width: 1400px;
    --layout-gutter: 18px;
}

@keyframes gentle-wiggle {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }

    20% {
        transform: rotate(-2deg) scale(1.015);
    }

    40% {
        transform: rotate(2deg) scale(0.995);
    }

    60% {
        transform: rotate(-1.5deg) scale(1.01);
    }

    80% {
        transform: rotate(1deg) scale(1);
    }
}

body {
    background-color: var(--colour-background);
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    line-height: 1.5;

    &:has(main) {
        display: flex;
        flex-direction: column;
        min-height: 100vh;

        main {
            flex: 1;

            display: flex;
            flex-direction: column;
            gap: calc(var(--layout-gutter) * 2);
            margin-bottom: calc(var(--layout-gutter) * 2);
        }
    }

    .contained {
        max-width: var(--layout-width);
        padding: 0 var(--layout-gutter);
        margin: 0 auto;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sorts Mill Goudy', sans-serif;
    font-weight: normal;
    line-height: 1.2;
    color: var(--colour-primary);

    span.accent {
        color: var(--colour-text-accent);
    }
}

header {
    height: 120px;

    .contained {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100%;

        a, img {
            height: 100%;
        }

        @media (max-width: 460px) {
            a.button {
                display: none;
            }

            justify-content: center;
        }

        &:not(:has(nav)) {
            justify-content: center;
        }
    }
}

footer {
    background-color: var(--colour-secondary);
    padding-bottom: var(--layout-gutter);
    
    .contained {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;

        img {
            max-width: 300px;
            width: 100%;
        }
    }
}

button, .button {
    --colour: pink;
    --textColour: white;

    &.primary {
        --colour: var(--colour-primary);
        --textColour: white;
    }

    &.secondary {
        --colour: var(--colour-secondary);
        --textColour: black;
    }

    display: block;
    width: fit-content;
    padding-left: 35px;
    padding-right: 35px;
    border-radius: 15px;
    height: 50px !important;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
    user-select: none;

    background-color: var(--colour);
    color: var(--textColour);
    font-weight: bold;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--layout-gutter) / 2);

    &:hover {
        background-color: color-mix(in srgb, var(--colour) 75%, black);
    }

    &:active {
        background-color: color-mix(in srgb, var(--colour) 50%, black);
    }

    &[disabled] {
        --colour: silver !important;
        --textColour: white !important;
        cursor: not-allowed;

        &:hover {
            background-color: var(--colour);
        }

        &:active {
            background-color: var(--colour);
            pointer-events: none;
        }
    }

    &.loading {
        > * {
            display: none;
        }
        
        min-height: var(--skeleton-min-height, 30px);
        background: #e5e5e5;
        color: transparent !important;
        overflow: hidden;
        
        cursor: wait;

        &:active {
            pointer-events: none;
        }

        &::after {
            content: "";
            position: absolute;
            inset: 0;
            transform: translateX(-100%);
            background: linear-gradient(
                90deg,
                transparent,
                rgba(255, 255, 255, 0.8),
                transparent
            );
            animation: skeleton-shimmer 1.2s infinite;
        }
    }

    svg {
        width: 20px;
        height: 20px;
    }
}

div.sep {
    background-color: var(--colour-text-accent);
    width: 200px;
    height: 5px;
    margin: var(--layout-gutter) 0;
}

img.masked {
    max-width: 300px;
    width: 100%;
    background-color: lime;
    aspect-ratio: 1/1;
    object-fit: cover;
    object-position: center;

    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;

    &.mask-1 {
        mask-image: url("../images/splodge-mask-1-Vs_EHQc.svg");
    }

    &.mask-2 {
        mask-image: url("../images/splodge-mask-2-f0sRyHU.svg");
    }
}

label.input {
    span {
        display: block;
        font-family: 'Sorts Mill Goudy', sans-serif;
        text-transform: uppercase;
        font-weight: bold;
    }

    input {
        width: 100%;
        border: solid 1px var(--colour-secondary);
        padding: calc(var(--layout-gutter) / 2);
        border-radius: 9px;
        font-size: 1.2rem;

        &:active, &:focus {
            border-color: var(--colour-primary);
        }
    }
}

div.input-row {
    display: flex;
    gap: calc(var(--layout-gutter) / 2);
    align-items: flex-start;

    label.input {
        flex: 1;
    }

    @media (max-width: 600px) {
        flex-direction: column;
        align-items: stretch;

        label.input {
            width: 100%;
        }
    }
}

form {
    display: flex;
    flex-direction: column;
    gap: var(--layout-gutter);

    div.error {
        flex: 1;
        width: 100%;
        border-left: solid 5px var(--colour-text-accent);
        padding: calc(var(--layout-gutter) / 2);
        background-color: #fdfbed;

        &:empty {
            display: none;
        }
    }
}

div.splodge:has(img) {
    position: relative;
    aspect-ratio: 1 / 1;

    display: flex;
    align-items: center;
    justify-content: center;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: var(--background);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        z-index: 1;
        animation: gentle-wiggle 5s ease-in-out infinite;
        animation-delay: var(--wiggle-delay, 0s);
        animation-direction: var(--wiggle-direction, normal);
        transform-origin: center;
    }
    
    img {
        max-width: 70%;
        max-height: 70%;
        object-fit: contain;
        position: relative;
        z-index: 2;
    }

    &.green {
        --background: url("../images/icons/splodge-green-Ly43Uip.png");
    }

    &.orange {
        --background: url("../images/icons/splodge-orange-oVjbjmc.png");
    }

    &.purple {
        --background: url("../images/icons/splodge-purple-GSrlKDD.png");
    }

    &.yellow {
        --background: url("../images/icons/splodge-yellow-BwI_as9.png");
    }
}

[data-skeleton] {
    position: relative;
    overflow: hidden;
    
    &.skeleton, &[data-skeleton-active] {
        > * {
            display: none !important;
        }
        
        min-height: var(--skeleton-min-height, 30px);
        background: #e5e5e5;
        color: transparent !important;

        &::after {
            content: "";
            position: absolute;
            inset: 0;
            transform: translateX(-100%);
            background: linear-gradient(
                90deg,
                transparent,
                rgba(255, 255, 255, 0.8),
                transparent
            );
            animation: skeleton-shimmer 1.2s infinite;
        }
    }
}

@keyframes skeleton-shimmer {
    to {
        transform: translateX(100%);
    }
}

[data-height-match] {
    height: 0;
}

.lined-header {
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
    gap: var(--layout-gutter);
    font-size: 1.2rem;

    &::before, &::after {
        content: '';
        display: block;
        width: 100px;
        height: 2px;
        background-color: var(--colour-text-accent);
    }
}

div.quantity {
    display: flex;
    align-items: center;

    button, input {
        height: 35px !important;
        width: 35px;
        padding: 0 !important;
    }

    input {
        text-align: center;
        border: 0;
    }

    button {
        border-radius: 50%;

        &.negative {
            --colour: #fcd1be;
        }

        &.positive {
            --colour: #b2d094;
        }
    }
}