/**
 * Footer — ADGO full-viewport closing section
 */

/* Contact stacks above footer during scroll parallax (footer slides up underneath) */
#main-content {
    position: relative;
    z-index: 1;
}

.site-footer {
    --footer-border: rgb(255 255 255 / 0.08);
    --color-border: var(--footer-border);
    position: relative;
    z-index: 0;
}

.site-footer[data-theme='dark'] {
    --color-background: #141314;
    --color-foreground: #eeeeee;
    --color-foreground-muted: #888888;
    --color-surface: #333333;
    --color-brand: #00f2ff;
}

/* Contact CTA — inverted on dark footer (matches contact morph) */
.site-footer .footer-contact-cta.adgo-cta-morph .left-icon,
.site-footer .footer-contact-cta.adgo-cta-morph .text-block,
.site-footer .footer-contact-cta.adgo-cta-morph .right-icon {
    background-color: var(--color-foreground);
    color: var(--color-background);
}

.site-footer .footer-contact-cta.adgo-cta-morph:focus-visible {
    outline: 2px solid rgb(0 242 255 / 0.5);
    outline-offset: 2px;
}

.site-footer .footer-contact-cta [data-scramble-target] .scramble-brand {
    color: var(--color-brand);
}

.site-footer .footer-contact-cta [data-scramble-target] .scramble-inherit {
    color: inherit;
}

.footer-cta-title,
.footer-cta-lead {
    margin: 0;
}

.footer-cta-lead {
    max-width: 22rem;
}

/* Pulse status dots */
.footer-pulse-dot {
    animation: footer-dot-pulse 2s ease-in-out infinite;
}

@keyframes footer-dot-pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Scramble nav — same pattern as partners-slider__name */
.footer-nav-scramble {
    display: inline-block;
    min-height: 1em;
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    color: inherit;
}

.footer-nav-scramble .scramble-brand {
    color: var(--color-brand);
}

.footer-nav-scramble .scramble-inherit {
    color: inherit;
}

.site-footer nav[aria-label='Footer navigation'] li {
    display: flex;
    justify-content: flex-start;
}

@media (min-width: 1024px) {
    .site-footer nav[aria-label='Footer navigation'] li {
        justify-content: center;
        width: 100%;
    }
}

.footer-nav-link {
    display: inline-block;
    letter-spacing: -0.02em;
    text-decoration: none;
    transition: color 200ms ease-out;
}

.footer-nav-link:hover {
    color: var(--color-brand);
}

.footer-nav-link:hover .footer-nav-scramble,
.footer-nav-link:focus-visible .footer-nav-scramble {
    color: var(--color-brand);
}

.footer-visitor-stats {
    margin-top: 1.35rem;
    font-family: var(--font-ui);
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--color-foreground-muted);
}

.footer-visitor-stats__line {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: fit-content;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
}

.footer-visitor-stats [data-footer-visitor-scramble] {
    display: inline-block;
    min-height: 1em;
    color: inherit;
}

.footer-visitor-stats .scramble-brand {
    color: var(--color-brand);
}

.footer-visitor-stats .scramble-inherit {
    color: inherit;
}

.footer-visitor-stats__line + .footer-visitor-stats__line {
    margin-top: 0.55rem;
}

.footer-visitor-stats__dot {
    position: relative;
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;
    background: rgb(255 255 255 / 0.5);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
}

.footer-visitor-stats__dot--live {
    background: var(--color-brand);
    box-shadow:
        0 0 0 1px rgb(0 242 255 / 0.22),
        0 0 14px rgb(0 242 255 / 0.55);
    animation: footer-visitor-dot-pulse 1.8s ease-in-out infinite;
}

.footer-visitor-stats__dot--live::after {
    content: '';
    position: absolute;
    inset: -0.3rem;
    border: 1px solid rgb(0 242 255 / 0.36);
    opacity: 0;
    animation: footer-visitor-dot-ring 1.8s ease-in-out infinite;
}

@keyframes footer-visitor-dot-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.55;
        transform: scale(0.78);
    }
}

@keyframes footer-visitor-dot-ring {
    0% {
        opacity: 0.55;
        transform: scale(0.65);
    }

    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

@media (max-width: 420px) {
    .footer-visitor-stats {
        margin-top: 1.25rem;
    }
}

/* Split-line reveal */
.footer-split-lines .split-line-mask,
.site-footer [data-footer-split].split-line-mask {
    overflow: clip;
}

.footer-split-lines .split-line,
.site-footer [data-footer-split] .split-line {
    display: block;
    will-change: transform;
}

.site-footer .underline-line-1,
.site-footer .underline-line-2 {
    transition-timing-function: cubic-bezier(0.625, 0.05, 0, 1);
}

/* Watermark */
.footer-watermark {
    transform: translateY(12%);
    will-change: transform;
}

.footer-watermark.animate-watermark {
    animation: footer-watermark-in 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes footer-watermark-in {
    from {
        transform: translateY(12%);
    }

    to {
        transform: translateY(0);
    }
}

/* Grid debug overlay (utility button) */
body.footer-grid-debug::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to right,
        rgb(0 242 255 / 0.06) 0,
        rgb(0 242 255 / 0.06) calc((100% - 32px * 2 - 16px * 11) / 12),
        transparent calc((100% - 32px * 2 - 16px * 11) / 12),
        transparent calc((100% - 32px * 2 - 16px * 11) / 12 + 16px)
    );
    background-size: calc(100% / 12) 100%;
}

@media (prefers-reduced-motion: reduce) {
    .footer-pulse-dot {
        animation: none;
        opacity: 1;
    }

    .footer-visitor-stats__dot--live,
    .footer-visitor-stats__dot--live::after {
        animation: none;
    }

    .footer-watermark {
        transform: none;
    }

    .footer-watermark.animate-watermark {
        animation: none;
    }

    #footer-grid-container {
        opacity: 1 !important;
    }

    .site-footer {
        transform: none !important;
    }
}
