/** ======================================== */
/** Final CTA — full-viewport closing section with a kinetic headline. */
/*= Ported verbatim (behavior) from the designer's custom/final_cta module. */
/*= module.js adds .dct-in on reveal, rotates the outcome word, fits the */
/*= headline to two lines and drives the magnetic button (--mx/--my). */
/** ======================================== */

.dct {
    --coral: var(--color-coral);
    --body: var(--color-grey-200);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 100svh;
    display: flex;
    align-items: center;
    /*= Warm glow: #31201d ≈ 14.5% coral into grey-900 */
    background: radial-gradient(ellipse 44% 40% at 50% 46%,
            color-mix(in srgb, var(--color-coral) 14.5%, var(--color-grey-900)) 0%,
            color-mix(in srgb, var(--color-coral) 14.5%, var(--color-grey-900)) 42%,
            var(--color-grey-900) 100%);
    background-color: var(--color-grey-900);
    color: var(--color-white);
    font-family: var(--font-body), "DM Sans", system-ui, sans-serif;
    padding: 120px 0;
}

.dct * {
    box-sizing: border-box;
}

/*+ Content */
.dct-inner {
    position: relative;
    width: 100%;
    min-width: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dct .dct-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 26px;
    font-family: var(--font-mono), "IBM Plex Mono", ui-monospace, Menlo, monospace;
    line-height: 21px;
    text-transform: uppercase;
}

/*- Headline */
.dct .dct-title {
    margin: 0;
    font-family: var(--font-heading), "Anton", "DM Sans", sans-serif;
    text-transform: uppercase;
    line-height: 1.02;
    letter-spacing: 0;
    max-width: none;
    width: 100%;
}

.dct-line {
    display: block;
    white-space: nowrap;
}

.dct-w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding: .02em 0 .06em;
}

.dct-w > span {
    display: inline-block;
    transform: translateY(110%) rotate(4deg);
    transform-origin: 0 100%;
    transition: transform 1.1s cubic-bezier(.16, 1, .3, 1) var(--d, 0s);
}

.dct.dct-in .dct-w > span {
    transform: none;
}

/*- Rotating outcome word — color comes from style.title.highlight_color */
.dct-rot {
    display: inline-block;
    height: 1.04em;
    overflow: hidden;
    vertical-align: top;
    transition: width .7s cubic-bezier(.16, 1, .3, 1);
}

.dct-rot-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform .8s cubic-bezier(.7, 0, .2, 1);
}

.dct-rot-i {
    display: block;
    height: 1.04em;
    white-space: nowrap;
    text-align: left;
}

/*- Subtext — color comes from style.content */
.dct-sub {
    margin: 30px auto 0;
    max-width: 620px;
    font-size: clamp(17px, 1.35vw, 20px);
    line-height: 1.55;
}

/*= Rich-text subtext: keep the single-paragraph spacing and the Style-tab colour */
.dct-sub p {
    margin: 0 0 0.6em;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.dct-sub p:last-child {
    margin-bottom: 0;
}

/*~ Reveal */
.dct-up {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .9s cubic-bezier(.16, 1, .3, 1) var(--d, 0s), transform .9s cubic-bezier(.16, 1, .3, 1) var(--d, 0s);
}

.dct.dct-in .dct-up {
    opacity: 1;
    transform: none;
}

/*+ CTAs */
.dct-ctas {
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

/*- Coral button — white wipe on hover, magnetic offset from module.js */
.dct-btn {
    position: relative;
    display: inline-block;
    text-decoration: none;
    border-radius: 0 14px 14px 14px;
    background: var(--coral);
    color: var(--color-white);
    transform: translate3d(var(--mx, 0), var(--my, 0), 0);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.dct-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--color-white);
    clip-path: inset(0 100% 0 0);
    transition: clip-path .5s cubic-bezier(.7, 0, .2, 1);
}

.dct-btn:hover::before,
.dct-btn:focus-visible::before {
    clip-path: inset(0 0 0 0);
}

.dct-btn-in {
    position: relative;
    display: flex;
    align-items: center;
    padding: 18px 36px;
}

.dct-btn-t {
    font-family: var(--font-heading), "Anton", "DM Sans", sans-serif;
    font-size: 22px;
    letter-spacing: .02em;
    text-transform: uppercase;
    transition: color .35s;
}

.dct-btn:hover .dct-btn-t,
.dct-btn:focus-visible .dct-btn-t {
    color: var(--color-grey-900);
}

/*- Arrow text link — underline draws in on hover */
.dct-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-white);
    text-decoration: none;
    font-family: var(--font-heading), "Anton", "DM Sans", sans-serif;
    font-size: 18px;
    letter-spacing: .02em;
    text-transform: uppercase;
    padding: 6px 0;
}

.dct-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .45s cubic-bezier(.7, 0, .2, 1);
}

.dct-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.dct-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .35s;
}

.dct-link:hover svg {
    transform: translateX(5px);
}

/*+ Steps */
.dct-steps {
    list-style: none;
    margin: 72px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 220px));
    gap: 64px;
}

.dct-step {
    position: relative;
    padding: 0;
    text-align: left;
    font-size: 15px;
    line-height: 1.4;
    color: var(--body);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .8s cubic-bezier(.16, 1, .3, 1) var(--d, 0s), transform .8s cubic-bezier(.16, 1, .3, 1) var(--d, 0s);
}

.dct.dct-in .dct-step {
    opacity: 1;
    transform: none;
}

.dct-step-n {
    display: block;
    font-family: var(--font-mono), "IBM Plex Mono", ui-monospace, monospace;
    font-size: 12px;
    color: var(--color-white);
    opacity: .75;
    margin-bottom: 6px;
}

.dct-step-t {
    display: block;
}

/*+ Rotating badge */
.dct-badge {
    position: absolute;
    z-index: 2;
    right: clamp(24px, 4.5vw, 88px);
    top: clamp(96px, 11vh, 140px);
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    color: var(--color-white);
    text-decoration: none;
    opacity: 0;
    transform: scale(.6) rotate(-30deg);
    transition: opacity .9s cubic-bezier(.16, 1, .3, 1) 1.1s, transform 1.2s cubic-bezier(.16, 1, .3, 1) 1.1s;
}

.dct.dct-in .dct-badge {
    opacity: 1;
    transform: none;
}

.dct-badge-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: dct-spin 16s linear infinite;
}

.dct-badge:hover .dct-badge-ring {
    animation-duration: 5s;
}

.dct-badge-ring text {
    font-family: var(--font-mono), "IBM Plex Mono", ui-monospace, monospace;
    font-size: 15.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    fill: rgb(255 255 255 / .85);
}

.dct-badge-c {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-heading), "Anton", sans-serif;
    font-size: 20px;
    transition: transform .4s cubic-bezier(.2, .8, .2, 1), background .3s, color .3s;
}

.dct-badge:hover .dct-badge-c {
    transform: scale(1.12);
    background: var(--coral);
    color: var(--color-white);
}

@keyframes dct-spin {
    to {
        transform: rotate(360deg);
    }
}

/*+ Outline marquee */
.dct-mq {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28px;
    overflow: hidden;
    pointer-events: none;
}

.dct-mq-t {
    display: flex;
    align-items: center;
    width: max-content;
    animation: dct-mq 38s linear infinite;
}

.dct-mq-t span {
    font-family: var(--font-heading), "Anton", sans-serif;
    text-transform: uppercase;
    font-size: clamp(56px, 7.5vw, 128px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgb(255 255 255 / .22);
    padding: 0 .3em;
}

.dct-mq-t i {
    font-style: normal;
    font-size: clamp(34px, 4vw, 64px);
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

@keyframes dct-mq {
    to {
        transform: translateX(-50%);
    }
}

/*+ Responsive */
@media (max-width: 1100px) {
    .dct-badge {
        display: none;
    }
}

@media (max-width: 760px) {
    .dct {
        padding: 96px 0;
        min-height: 100svh;
    }

    .dct-ctas {
        flex-direction: column;
        gap: 18px;
    }

    .dct-btn-t {
        font-size: 20px;
    }

    .dct-steps {
        grid-template-columns: 1fr;
        gap: 22px;
        margin-top: 48px;
        width: 100%;
        max-width: 300px;
    }

    .dct-mq {
        bottom: 16px;
    }
}

/*~ Focus rings — the global burgundy outline vanishes on the grey-900 section */
.dct a:focus-visible,
.dct button:focus-visible { outline: 2px solid var(--color-white); outline-offset: 4px; }

/*~ No-JS safety — the reveal states above only hide content when JS can undo them
/*= html.js is set in <head> by module.html. Without JS everything shows at once;
/*= if this module's script never boots, the failsafe reveals it after 2.5s. */
html:not(.js) .dct .dct-w > span,
html:not(.js) .dct .dct-up,
html:not(.js) .dct .dct-step,
html:not(.js) .dct .dct-badge {
    opacity: 1;
    transform: none;
    transition: none;
}

.js .dct:not([data-final-cta-ready]) .dct-w > span,
.js .dct:not([data-final-cta-ready]) .dct-up,
.js .dct:not([data-final-cta-ready]) .dct-step,
.js .dct:not([data-final-cta-ready]) .dct-badge {
    animation: dct-failsafe 0s 2.5s forwards;
}

@keyframes dct-failsafe {
    to {
        opacity: 1;
        transform: none;
    }
}

/*= Reduced motion cancels the failsafe animation, so show unbooted content directly */
@media (prefers-reduced-motion: reduce) {
    .js .dct:not([data-final-cta-ready]) .dct-w > span,
    .js .dct:not([data-final-cta-ready]) .dct-up,
    .js .dct:not([data-final-cta-ready]) .dct-step,
    .js .dct:not([data-final-cta-ready]) .dct-badge {
        opacity: 1;
        transform: none;
    }
}

/*~ Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .dct *,
    .dct *::before,
    .dct *::after {
        animation: none !important;
        transition: none !important;
    }

    .dct .dct-w > span,
    .dct .dct-up,
    .dct .dct-step,
    .dct .dct-badge {
        opacity: 1;
        transform: none;
    }
}
