/* ==========================================================
   ws-footer.css
   Site footer and pre-footer card. All pages but landings.
   Owns ws-footer, ws-prefooter. Markup: inc/site-footer.php
   ========================================================== */

:root {
    /* Card dips into footer this much */
    --ws-prefooter-overlap: clamp(104px, 11vw, 150px);
    --ws-footer-air: clamp(56px, 6vw, 72px);
    --ws-prefooter-top: var(--ws-footer-air);
}

/* Dark both themes. Bookend to dark hero */
.ws-footer {
    --wsft-bg: var(--ws-charcoal);
    --wsft-fg: var(--ws-white);
    --wsft-link: var(--ws-light-grey);
    --wsft-muted: var(--ws-grey);
    --wsft-line: #34343A;
}

/* === Pre-footer card === */
.ws-prefooter {
    position: relative;
    z-index: 1;
    padding-top: var(--ws-prefooter-top);
    background: var(--ws-prefooter-bg, var(--ws-bg));
}
.ws-prefooter__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}
/* Diagonal corners. Same exception as What I do cards */
.ws-prefooter__card {
    position: relative;
    margin-bottom: calc(-1 * var(--ws-prefooter-overlap));
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    padding: 56px 64px;
    background: var(--ws-surface);
    color: var(--ws-text);
    border-radius: var(--ws-radius) 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.22);
}
/* Dark card on dark footer. Hairline keep edge */
[data-theme="dark"] .ws-prefooter__card {
    box-shadow: 0 0 0 1px #34343A, 0 30px 60px rgba(0, 0, 0, 0.5);
}

.ws-prefooter__h {
    margin: 0;
    font-family: var(--ws-font);
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ws-heading);
}
/* Own line. Word length no reflow.
   Clip not overflow. Headroom for kick */
.ws-prefooter__roll {
    /* Tick knobs. Same as start page, ws-contact.css. Change both */
    --tick-dur: 0.38s;   /* rise. Lower snappier */
    --tick-from: 110%;   /* start depth. Higher faster */
    --tick-kick: -22%;   /* overshoot. Past -30% clips */
    --tick-back: 7%;     /* rebound. 0 = none */
    --tick-out: 0.12s;   /* old word out */
    --tick-gap: 0.12s;   /* wait before rise */
    position: relative;
    display: block;
    margin-top: 6px;
    padding-bottom: 0.1em;
    clip-path: inset(-0.35em -1em 0 -0.5em);
    white-space: nowrap;
}
.ws-prefooter__word { display: inline-block; }
/* Start page flip. Old out, gap, new snaps up, kicks, sits */
.ws-prefooter__word.is-in { animation: wsPfTick var(--tick-dur) var(--tick-gap) both; }
.ws-prefooter__word.is-out {
    position: absolute;
    top: 0;
    left: 0;
    animation: wsPfFlick var(--tick-out) cubic-bezier(0.6, 0, 1, 1) both;
}
/* Kick 45%, rebound 72%. Earlier punchier */
@keyframes wsPfTick {
    0%   { transform: translateY(var(--tick-from)); animation-timing-function: cubic-bezier(0.25, 0, 0, 1); }
    45%  { transform: translateY(var(--tick-kick)); animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1); }
    72%  { transform: translateY(var(--tick-back)); animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1); }
    100% { transform: none; }
}
@keyframes wsPfFlick {
    from { transform: none; }
    to   { transform: translateY(-140%); }
}

.ws-prefooter__text {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--ws-muted);
    text-wrap: pretty;
}
.ws-prefooter__actions {
    margin-top: 26px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
}
.ws-prefooter__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
}
.ws-prefooter__arrow {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s ease;
}
.ws-prefooter__btn:hover .ws-prefooter__arrow,
.ws-prefooter__btn:focus-visible .ws-prefooter__arrow { transform: translateX(4px); }
/* Base kill outline. Ring back for keyboard */
.ws-prefooter__btn:focus-visible { outline: 2px solid var(--ws-text); outline-offset: 3px; }
.ws-prefooter__link { font-size: 15px; font-weight: 700; }

/* === Footer === */
.ws-footer {
    margin-top: 60px;
    padding: var(--ws-footer-air) 0 40px;
    background: var(--wsft-bg);
    color: var(--wsft-fg);
}
/* Page and footer both charcoal in dark. Line split */
[data-theme="dark"] .ws-footer { box-shadow: inset 0 1px 0 var(--wsft-line); }
.ws-footer.has-prefooter {
    margin-top: 0;
    padding-top: calc(var(--ws-prefooter-overlap) + var(--ws-footer-air));
}
.ws-footer__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}
.ws-footer__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
    gap: 64px;
}

.ws-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    max-width: 300px;
}
.ws-footer__logo { display: block; border-radius: var(--ws-radius); }
.ws-footer__logo img { display: block; width: auto; height: 36px; max-width: none; }
.ws-footer__tagline {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--wsft-muted);
}

.ws-footer__cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
}
.ws-footer__title {
    margin: 0 0 14px;
    font-family: var(--ws-font);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--wsft-muted);
}
.ws-footer__list,
.ws-footer__legal-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ws-footer__list { display: grid; gap: 10px; }
.ws-footer__list li,
.ws-footer__legal-list li { margin: 0; }

.ws-footer__link {
    font-size: 15px;
    line-height: 1.5;
    color: var(--wsft-link);
    text-decoration: none;
}
@media (hover: hover) {
    .ws-footer__link:hover {
        color: var(--wsft-fg);
        text-decoration: underline;
        text-decoration-color: var(--ws-accent);
        text-decoration-thickness: 2px;
        text-underline-offset: 4px;
        transition: color 0.2s ease;
    }
}
/* Current page. Not color alone */
.ws-footer__link[aria-current="page"] {
    color: var(--wsft-fg);
    text-decoration: underline;
    text-decoration-color: var(--ws-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}
.ws-footer__link:focus-visible,
.ws-footer__logo:focus-visible {
    outline: 2px solid var(--ws-accent);
    outline-offset: 3px;
    border-radius: var(--ws-radius-sm);
}

.ws-footer__bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--wsft-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    font-size: 13px;
    color: var(--wsft-muted);
}
.ws-footer__copy { margin: 0; font-size: 13px; }
.ws-footer__legal-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.ws-footer__link--small { font-size: 13px; color: var(--wsft-muted); }

/* === Tablet === */
/* Longest word clip at 40px in two columns. Stack first */
@media (max-width: 999px) {
    .ws-prefooter__card {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 44px 40px;
    }
    .ws-prefooter__h { font-size: clamp(1.5rem, 6.8vw, 2.5rem); }
    .ws-footer__top { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .ws-footer__brand { max-width: 420px; }
}

/* === Phones === */
@media (max-width: 600px) {
    .ws-prefooter__card {
        padding: 32px 22px;
        border-radius: var(--ws-radius) 28px;
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    }
    .ws-prefooter__text { font-size: 1rem; }
    .ws-prefooter__actions { flex-direction: column; align-items: stretch; margin-top: 24px; }
    .ws-prefooter__link { align-self: center; }
    .ws-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
}
/* 320 phones. Same gutter as header */
@media (max-width: 374px) {
    .ws-prefooter__inner,
    .ws-footer__inner { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .ws-prefooter__word.is-in,
    .ws-prefooter__word.is-out { animation: none; }
    .ws-prefooter__word.is-out { display: none; }
    .ws-prefooter__arrow,
    .ws-footer__link:hover { transition: none; }
}
