/* Footer: the molecule as a window on the page, and beside it a framed print of a Sadu weave
   (السدو), the Bedouin weaving of Saudi Arabia and the Gulf, drawn in pixels in a three-colour
   palette of olive, cream and blue. The print carries the name in Arabixel Adventure and a few
   lines in Arabixel Basic. */

.site-footer {
    padding-block: clamp(5rem, 10vw, 8rem) 2rem;
}

.footer-grid {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

.sadu {
    --olive: #527a46;
    --cream: #f3e3b0;
    --blue: #4b5fd6;
    position: relative;
    padding: clamp(28px, 4vw, 52px);
    border: 4px solid var(--cream);
    background: var(--olive);
    color: var(--cream);
    text-align: right;
    overflow: hidden;
}

/* Two masks over the olive: motifs in cream, eye centres and edge stitches in blue. */
.sadu::before,
.sadu::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    -webkit-mask: var(--weave) 0 0 / 96px 96px repeat;
    mask: var(--weave) 0 0 / 96px 96px repeat;
}

.sadu::before {
    --weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM0 2h1v1h-1zM0 11h1v1h-1zM0 20h1v1h-1zM0 21h1v1h-1zM1 0h1v1h-1zM1 2h1v1h-1zM1 3h1v1h-1zM1 10h1v1h-1zM1 12h1v1h-1zM1 21h1v1h-1zM2 0h1v1h-1zM2 2h1v1h-1zM2 3h1v1h-1zM2 4h1v1h-1zM2 9h1v1h-1zM2 13h1v1h-1zM3 0h1v1h-1zM3 2h1v1h-1zM3 3h1v1h-1zM3 8h1v1h-1zM3 14h1v1h-1zM3 21h1v1h-1zM4 0h1v1h-1zM4 2h1v1h-1zM4 7h1v1h-1zM4 15h1v1h-1zM4 20h1v1h-1zM4 21h1v1h-1zM5 0h1v1h-1zM5 6h1v1h-1zM5 16h1v1h-1zM5 19h1v1h-1zM5 20h1v1h-1zM5 21h1v1h-1zM6 0h1v1h-1zM6 2h1v1h-1zM6 7h1v1h-1zM6 15h1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1zM21 10h1v1h-1zM21 12h1v1h-1zM21 21h1v1h-1zM22 0h1v1h-1zM22 2h1v1h-1zM22 11h1v1h-1zM22 20h1v1h-1zM22 21h1v1h-1zM23 0h1v1h-1zM23 19h1v1h-1zM23 20h1v1h-1zM23 21h1v1h-1z'/%3E%3C/svg%3E");
    background: var(--cream);
}

.sadu::after {
    --weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath d='M0 23h1v1h-1zM2 23h1v1h-1zM4 11h1v1h-1zM4 23h1v1h-1zM5 10h1v1h-1zM5 11h1v1h-1zM5 12h1v1h-1zM6 11h1v1h-1zM6 23h1v1h-1zM8 23h1v1h-1zM10 23h1v1h-1zM12 23h1v1h-1zM14 23h1v1h-1zM16 11h1v1h-1zM16 23h1v1h-1zM17 10h1v1h-1zM17 11h1v1h-1zM17 12h1v1h-1zM18 11h1v1h-1zM18 23h1v1h-1zM20 23h1v1h-1zM22 23h1v1h-1z'/%3E%3C/svg%3E");
    background: var(--blue);
}

.sadu > * {
    position: relative;
    z-index: 1;
}

/* The name in a speech bubble, after the museum poster's mark. Adventure is drawn on a 13px grid. */
.ar-bubble {
    position: relative;
    display: inline-block;
    margin-bottom: 2.75rem;
    padding: 6px 24px 14px;
    background: var(--olive);
    box-shadow: 0 0 0 4px var(--cream);
    font: 52px / 1.2 var(--font-ar-name);
}

.ar-bubble::after {
    content: "";
    position: absolute;
    left: 22px;
    top: calc(100% + 4px);
    width: 28px;
    height: 24px;
    background: var(--cream);
    clip-path: polygon(0 0, 100% 0, 100% 17%, 86% 17%, 86% 33%, 71% 33%, 71% 50%, 57% 50%, 57% 67%, 43% 67%, 43% 83%, 29% 83%, 29% 100%, 0 100%);
}

/* Basic is drawn on an 11px grid; the blue shadow sits one pixel off, like a misregistered print. */
.ar-lines {
    font: 44px / 1.3 var(--font-ar);
    text-shadow: 4px 4px 0 var(--blue);
}

/* Each line sits on its own strip of olive so the weave never runs through the letters. */
.ar-lines span {
    display: block;
    width: fit-content;
    margin-top: 8px;
    padding: 0 14px 4px;
    background: var(--olive);
}

.mol-win canvas {
    width: 100%;
    margin-top: 3px;
    aspect-ratio: 4 / 3;
    background: var(--ink);
    box-shadow: var(--sunken);
}

.mol-win figcaption {
    padding: 8px 6px 4px;
    font: var(--ui-size) / 1.35 var(--ui);
    color: var(--stone-ink);
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    margin-top: clamp(3rem, 6vw, 4.5rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font: var(--ui-size) / 1.4 var(--ui);
    color: var(--fog);
}

.footer-meta a {
    color: var(--paper);
}

.footer-meta .b64 {
    flex-basis: 100%;
}

@media (min-width: 900px) {
    .footer-grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        gap: 3rem;
    }
}

@media (max-width: 899px) {
    .ar-bubble {
        font-size: 39px;
    }

    .ar-lines {
        font-size: 33px;
        text-shadow: 3px 3px 0 var(--blue);
    }
}
