.global-site-footer {
    position: relative;
    isolation: isolate;
    width: min(1180px, calc(100% - 56px));
    margin: 36px auto 0;
    padding: 0 0 max(30px, env(safe-area-inset-bottom));
    background-image: linear-gradient(90deg, transparent, var(--line), transparent);
    background-position: top center;
    background-repeat: no-repeat;
    background-size: 100% 1px;
    color: var(--text);
}

a.global-footer-brand {
    color: inherit;
    text-decoration: none;
}

/* Keep the existing palette glow low, just crossing the main section's lower edge. */
.global-footer-top::before {
    position: absolute;
    z-index: -1;
    inset: auto 0 -110px;
    height: 200px;
    background:
        radial-gradient(ellipse at 38% 100%, rgba(var(--accent-1-rgb), 0.2), transparent 52%),
        radial-gradient(ellipse at 62% 100%, rgba(var(--accent-3-rgb), 0.16), transparent 50%),
        radial-gradient(ellipse at 50% 112%, rgba(var(--accent-2-rgb), 0.3), transparent 68%);
    /* Feather the glow before its layer ends, using the existing Housing fade. */
    -webkit-mask-image: linear-gradient(#000 40%, transparent 100%);
    mask-image: linear-gradient(#000 40%, transparent 100%);
    content: "";
    opacity: 0.84;
    pointer-events: none;
}

.global-footer-top {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 64px;
    padding: 34px 0;
}

.global-footer-brand {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: center;
    gap: 0;
    color: var(--text);
    text-align: center;
    font: 400 1.55rem / 1.2 "Bungee", sans-serif;
}

.global-footer-hat {
    display: block;
    width: 120px;
    height: 100px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-mask: url("https://droog.uk/housing-images/icons/drooghat.svg?v=20260907") center / contain no-repeat;
    mask: url("https://droog.uk/housing-images/icons/drooghat.svg?v=20260907") center / contain no-repeat;
}

.global-footer-hat + span {
    /* Keep a small optical separation between the hat and wordmark. */
    transform: translateY(-2px);
}

.global-footer-navigation {
    --footer-column-width: 160px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 28px;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}

.global-footer-navigation[hidden] {
    display: none;
}

.global-footer-column {
    flex: 0 0 auto;
    min-width: 0;
}

.global-footer-column h2 {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    font: inherit;
    text-align: left;
}

.global-footer-column ul {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.global-footer-navigation a {
    display: flex;
    min-height: 34px;
    align-items: center;
    padding-block: 6px;
    color: var(--muted);
    font: 400 0.875rem / 1.45 "DM Sans", sans-serif;
    text-decoration: none;
    text-underline-offset: 0.3em;
    overflow-wrap: anywhere;
    transition: color 160ms ease;
}

.global-footer-navigation .global-footer-heading {
    gap: 9px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
}

.global-footer-column li a {
    min-height: 26px;
    padding-block: 3px;
    font-size: 0.8rem;
}

.global-footer-list-separator {
    display: block;
    padding-top: 3px;
    color: var(--muted);
    font: 400 0.8rem / 1 "DM Sans", sans-serif;
}

.global-footer-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: var(--accent-3);
}

.global-footer-navigation a[aria-current] {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent-3);
}

.global-footer-navigation a:hover,
.global-footer-navigation a:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

.global-footer-social {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1.5vw, 16px);
    padding: 60px 0 0;
}

.global-footer-social[hidden] {
    display: none;
}

.global-footer-social a {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--muted);
    text-decoration: none;
    transition: color 180ms ease;
}

.global-footer-social-icon {
    display: block;
    width: 40px;
    height: 40px;
    background: currentColor;
    -webkit-mask: var(--global-footer-social-icon) center / contain no-repeat;
    mask: var(--global-footer-social-icon) center / contain no-repeat;
    transition: filter 180ms ease, transform 180ms ease;
}

.global-footer-social a:hover,
.global-footer-social a:focus-visible {
    color: var(--accent-3);
}

.global-footer-social a:hover .global-footer-social-icon,
.global-footer-social a:focus-visible .global-footer-social-icon {
    filter: drop-shadow(0 0 8px rgba(var(--accent-3-rgb), 0.42));
    transform: translateY(-1px) scale(1.05);
}

.global-footer-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 12px;
    padding-top: 22px;
    background-image: linear-gradient(90deg, transparent, var(--line), transparent);
    background-position: top center;
    background-repeat: no-repeat;
    background-size: 100% 1px;
    text-align: center;
}

.global-footer-bottom p {
    width: min(100%, 900px);
    margin: 0;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.6;
}

@media (min-width: 761px) {
    .global-footer-brand {
        /* Give the desktop lockup a little more presence and breathing room from the edge. */
        transform: translateX(-28px);
        font-size: 1.7rem;
    }

    .global-footer-top {
        grid-template-columns: minmax(0, 1fr) 200px;
    }

    .global-footer-hat {
        width: 132px;
        height: 110px;
    }
}

@media (min-width: 901px) {
    .global-footer-lists {
        display: grid;
        align-items: start;
        grid-auto-flow: column;
        grid-auto-columns: var(--footer-column-width);
        column-gap: 12px;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .global-footer-navigation {
        --footer-column-width: 120px;
        gap: 24px;
    }

    .global-footer-lists {
        column-gap: 8px;
    }
}

@media (max-width: 900px) {
    .global-footer-top {
        grid-template-columns: minmax(0, 1fr) 140px;
        column-gap: 28px;
    }

    .global-footer-navigation {
        display: grid;
        grid-template-columns: repeat(var(--footer-column-count, 3), minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 760px) {
    .global-site-footer {
        width: calc(100% - 40px);
    }

    .global-footer-top {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        row-gap: 28px;
    }

    .global-footer-brand {
        grid-column: 1;
        grid-row: 2;
    }

    .global-footer-social {
        grid-column: 1;
        grid-row: 3;
        padding-top: 32px;
    }
}

@media (max-width: 640px) {
    .global-footer-navigation {
        gap: 12px;
    }

    .global-footer-navigation a {
        min-height: 44px;
    }

    .global-footer-column li a {
        min-height: 32px;
    }

    .global-footer-navigation .global-footer-heading {
        gap: 5px;
        font-size: 0.875rem;
    }

    .global-footer-icon {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }
}

@media (max-width: 380px) {
    .global-footer-navigation {
        gap: 8px;
    }

    .global-footer-navigation .global-footer-heading {
        gap: 4px;
        font-size: 0.8125rem;
    }

    .global-footer-icon {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }
}
