/*
Stripe Sessions style Flex Carousel — Simey
Source: https://codepen.io/simeydotme/pen/gOBMZMe
Copyright (c) Simey (https://codepen.io/simeydotme)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

/* Keep the reference's flex layout with shorter, explicitly scoped transitions. */
#slHomeFlexCarousel {
    --sl-flex-duration: 320ms;
    --height: clamp(430px, calc(80vh - 50px), 650px);
    --width: min(450px, calc(100vw - 80px));
    position: relative;
    isolation: isolate;
    width: 100%;
    margin: 0;
    padding: 48px 8px 36px;
    overflow: hidden;
    /* Focus must not create a separate scroll position inside the section. */
    overflow: clip;
    box-sizing: border-box;
    background: linear-gradient(125deg, #161127 0%, #0c142b 52%, #071d2a 100%);
    color: #edf1f7;
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: normal;
    text-align: left;
}
/* Slow ambient SL colors, independent of the card transitions and wave artwork. */
#slHomeFlexCarousel::before {
    content: "";
    position: absolute;
    inset: -6%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 0% 24%, rgba(46, 214, 255, .15), transparent 57%),
        radial-gradient(ellipse at 58% 100%, rgba(85, 97, 255, .26), transparent 65%),
        radial-gradient(ellipse at 100% 0%, rgba(255, 90, 217, .14), transparent 52%);
    transform: translate3d(1.5%, -1%, 0) scale(1.02);
    animation: sl-flex-ambient 56s ease-in-out infinite alternate paused;
}
#slHomeFlexCarousel[data-sl-waves-playing="true"]:not(.sl-flex-moving):not(.sl-flex-scrolling)::before { animation-play-state: running; }
@keyframes sl-flex-ambient {
    from { transform: translate3d(1.5%, -1%, 0) scale(1.02); }
    to { transform: translate3d(-1.5%, 1%, 0) scale(1.05); }
}
#slHomeFlexCarousel *,
#slHomeFlexCarousel *::before,
#slHomeFlexCarousel *::after { box-sizing: border-box; }
#slHomeFlexCarousel .sl-flex-heading { max-width: 1240px; margin: 0 auto 12px; padding: 0 20px; }
#slHomeFlexCarousel .sl-flex-heading h2 { margin: 0 0 14px; color: #edf1f7; font: 600 clamp(30px, 3vw, 42px)/1.15 'Heebo', sans-serif; letter-spacing: -.025em; }
#slHomeFlexCarousel .sl-flex-heading p { max-width: 760px; margin: 0; color: #cad4e3; font-size: 17px; line-height: 1.65; }
#slHomeFlexCarousel button {
    appearance: none;
    display: flex;
    align-items: center;
    gap: .5em;
    padding: .5em 1.5em;
    font: 400 16px 'Heebo', sans-serif;
    line-height: normal;
    letter-spacing: normal;
    color: #edf1f7;
    background: #17191c;
    border: 0;
    border-radius: 8px;
    margin: 0;
    min-height: 44px;
    cursor: pointer;
}
#slHomeFlexCarousel button svg { display: block; width: 24px; height: 24px; margin: 0; padding: 0; fill: none; }
#slHomeFlexCarousel button span { margin: 0; padding: 0; }
#slHomeFlexCarousel button path { fill: currentColor; }
#slHomeFlexCarousel button:hover { background: #22252b; }
#slHomeFlexCarousel button:focus-visible,
#slHomeFlexCarousel a:focus-visible,
#slHomeFlexCarousel .sl-flex-carousel__item:focus-visible { outline: 3px solid #9ebdfa !important; outline-offset: 3px; }
#slHomeFlexCarousel .sl-flex-carousel__item:focus-visible { outline-offset: -4px; }
.sl-flex-carousel { display: grid; transform: translate3d(0,0,0.1px); }
.sl-flex-carousel__list { display: flex; overflow: hidden; list-style: none; padding: 2em 0 3em; margin: 0; contain: layout; isolation: isolate; }
.sl-flex-carousel__item {
    --wave-bg: #22062e;
    --wave-glow: #700c67;
    --wave-line: #ee59ca;
    --wave-secondary: #ab41d7;
    --wave-accent: #ff99de;
    --wave-button: #f8d5ee;
    --wave-ink: #451638;
    --wave-phase: -3s;
    display: grid;
    position: relative;
    align-content: start;
    min-width: 0;
    margin: 0 10px;
    padding: 0;
    flex: 1 1 10%;
    height: var(--height);
    overflow: hidden;
    background: var(--wave-bg);
    border-radius: 16px;
    cursor: pointer;
    transform: translate3d(0,0,0.1px);
    box-shadow: rgba(0,0,0,.4) 0 3px 15px 2px, rgba(0,0,0,.2) 0 12px 28px, rgba(0,0,0,.1) 0 2px 4px, rgba(255,255,255,.05) 0 0 0 1px inset;
    contain: layout;
    isolation: isolate;
}
.sl-flex-carousel__item {
    transition-property: flex-basis, flex-grow, flex-shrink, margin, transform, opacity;
    transition-duration: var(--sl-flex-duration);
    transition-timing-function: cubic-bezier(.22,.61,.36,1);
}
.sl-flex-carousel__item[data-active] { flex-basis: var(--width); flex-grow: 0; cursor: default; }
.sl-flex-carousel__item[data-wave-theme="ocean"] { --wave-bg: #041c37; --wave-glow: #075b85; --wave-line: #4bcbf4; --wave-secondary: #3383dc; --wave-accent: #a6f4ff; --wave-button: #d0f5ff; --wave-ink: #123b51; --wave-phase: -11s; }
.sl-flex-carousel__item[data-wave-theme="mint"] { --wave-bg: #042820; --wave-glow: #08644b; --wave-line: #57e8b1; --wave-secondary: #18a09a; --wave-accent: #b5ffda; --wave-button: #d3fbe6; --wave-ink: #154632; --wave-phase: -7s; }
.sl-flex-carousel__item[data-wave-theme="amber"] { --wave-bg: #321506; --wave-glow: #8a3b0c; --wave-line: #ffb65b; --wave-secondary: #dd642e; --wave-accent: #ffe4a1; --wave-button: #ffebce; --wave-ink: #593613; --wave-phase: -16s; }
.sl-flex-carousel__item[data-wave-theme="indigo"] { --wave-bg: #101438; --wave-glow: #3a3184; --wave-line: #aca2ff; --wave-secondary: #637fe8; --wave-accent: #ded1ff; --wave-button: #e7e0ff; --wave-ink: #342653; --wave-phase: -5s; }
.sl-flex-carousel__item[data-wave-theme="rose"] { --wave-bg: #320d21; --wave-glow: #842446; --wave-line: #ff7ea7; --wave-secondary: #dc4983; --wave-accent: #ffc5cf; --wave-button: #ffe0e9; --wave-ink: #552138; --wave-phase: -19s; }
.sl-flex-carousel__art {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    background: radial-gradient(ellipse at 0% 10%, var(--wave-glow), transparent 65%), radial-gradient(ellipse at 100% 100%, var(--wave-glow), transparent 65%), var(--wave-bg);
    opacity: .85;
    transition: opacity 180ms ease;
}
.sl-flex-carousel__item:hover .sl-flex-carousel__art,
.sl-flex-carousel__item[data-active] .sl-flex-carousel__art { opacity: 1; }
.sl-flex-waves {
    position: absolute;
    width: var(--width);
    height: 100%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: block;
    max-width: none;
    overflow: visible;
}
.sl-flex-waves, .sl-flex-wave, .sl-flex-wave path { transition: none; }
.sl-flex-wave { position: absolute; inset: 0; transform-origin: center; animation-play-state: paused; animation-delay: var(--wave-phase); }
.sl-flex-wave--ribbon { color: var(--wave-line); opacity: .7; animation: sl-service-ribbon 19s ease-in-out infinite alternate paused; animation-delay: var(--wave-phase); }
.sl-flex-wave--crest { color: var(--wave-secondary); opacity: .7; animation: sl-service-crest 27s ease-in-out infinite alternate paused; animation-delay: var(--wave-phase); }
.sl-flex-wave--tide { color: var(--wave-accent); opacity: .45; animation: sl-service-tide 23s ease-in-out infinite alternate paused; animation-delay: var(--wave-phase); }
/* Animate the HTML layers of the open card; closed cards keep their wave artwork. */
#slHomeFlexCarousel[data-sl-waves-playing="true"] .sl-flex-carousel__item[data-active]:not([aria-hidden="true"]) .sl-flex-wave { will-change: transform; }
#slHomeFlexCarousel[data-sl-waves-playing="true"]:not(.sl-flex-moving):not(.sl-flex-scrolling) .sl-flex-carousel__item[data-active]:not([aria-hidden="true"]) .sl-flex-wave { animation-play-state: running; }
@keyframes sl-service-ribbon {
    from { transform: translate(-20px, 25px) rotate(-7deg) scale(1.08, .92); }
    to { transform: translate(22px, -30px) rotate(9deg) scale(.94, 1.12); }
}
@keyframes sl-service-crest {
    from { transform: translate(18px, -20px) rotate(8deg) scale(1.1, .9); }
    to { transform: translate(-32px, 38px) rotate(-11deg) scale(.98, 1.14); }
}
@keyframes sl-service-tide {
    from { transform: translate(-25px, 30px) rotate(-6deg) scale(.96, 1.12); }
    to { transform: translate(30px, -32px) rotate(8deg) scale(1.12, .94); }
}
.sl-flex-carousel__item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(160deg, rgba(4,8,18,.08), rgba(4,8,18,.3));
    transition: transform var(--sl-flex-duration) cubic-bezier(.22,.61,.36,1);
}
.sl-flex-carousel__item[data-active]::after { transform: translateY(100%); }
.sl-flex-carousel__contents {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 28px 24px 52px;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(8,10,24,.8), rgba(8,10,24,.5) 68%, transparent);
}
#slHomeFlexCarousel .sl-flex-name { margin: 0; padding: 0; color: #edf1f7; font: 600 clamp(24px, 2.2vw, 32px)/1.18 'Heebo', sans-serif; letter-spacing: -.02em; text-transform: none; overflow-wrap: anywhere; }
#slHomeFlexCarousel .sl-flex-title { margin: 0; padding: 0; color: #edf0f7; font: 400 16px/1.65 'Heebo', sans-serif; letter-spacing: normal; text-transform: none; }
#slHomeFlexCarousel .sl-flex-service-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--wave-button); border-radius: 8px; color: var(--wave-ink); background: var(--wave-button); font: 600 15px/1.4 'Heebo', sans-serif; text-decoration: none; }
#slHomeFlexCarousel .sl-flex-service-link:hover { color: var(--wave-ink); background: #fff; }
.sl-flex-carousel__contents > * { opacity: 0; transform: translateX(-28px); transition: opacity 180ms ease, transform 240ms ease-out; }
.sl-flex-carousel__item[data-active] .sl-flex-carousel__contents { pointer-events: auto; }
.sl-flex-carousel__item[data-active] .sl-flex-carousel__contents > * { opacity: 1; transform: translateX(0); }
.sl-flex-carousel__nav { padding: 1em; justify-self: end; grid-row: 1; display: flex; justify-content: space-between; gap: 1em; }
#slHomeFlexCarousel .sl-flex-footer { padding: 0 20px; text-align: center; }
#slHomeFlexCarousel .sl-flex-all-services { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; color: #d5f7e6; font: 400 16px/1.5 'Heebo', sans-serif; text-decoration: underline; text-underline-offset: 5px; }
#slHomeFlexCarousel .sl-flex-all-services:hover { color: #fff; }
@media (max-width: 800px) {
    .sl-flex-carousel__item { flex-basis: 15%; }
    .sl-flex-carousel__item[data-active] { flex-basis: 52%; flex-shrink: 0; }
    .sl-flex-carousel__contents { padding: 24px 20px 48px; }
}
/* Keep the recycled first/last slots invisible, as in the reference carousel. */
@media (min-width: 601px) {
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(3),
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(10) { flex: 0 0 10px; }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(2),
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(11) { flex: 0 0 5px; transform: translateX(-50px); }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(11) { transform: translateX(50px); }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:first-child,
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(n + 12) { flex: 0 0 0; margin: 0; box-shadow: none; opacity: 0; pointer-events: none; }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(-n + 3) *,
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(n + 10) * { opacity: 0; pointer-events: none; }
}
@media (max-width: 600px) {
    #slHomeFlexCarousel { --width: calc(100vw - 120px); padding-top: 32px; }
    #slHomeFlexCarousel .sl-flex-heading { padding: 0 12px; }
    #slHomeFlexCarousel .sl-flex-heading p { font-size: 15px; }
    #slHomeFlexCarousel .sl-flex-name { font-size: clamp(23px, 6vw, 28px); }
    #slHomeFlexCarousel .sl-flex-title { font-size: 14px; line-height: 1.6; }
    .sl-flex-carousel__item { flex-basis: 10%; margin: 0 3px; border-radius: 8px; }
    .sl-flex-carousel__item[data-active] { flex-basis: var(--width); flex-shrink: 0; }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(3),
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(7) { flex: 0 0 10px; }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(2),
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(8) { flex: 0 0 5px; margin: 0; transform: translateX(-50px); }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(8) { transform: translateX(50px); }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:first-child,
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(n + 9) { flex: 0 0 0; margin: 0; box-shadow: none; opacity: 0; pointer-events: none; }
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(-n + 3) *,
    #slHomeFlexCarousel[data-sl-flex-ready] .sl-flex-carousel__item:nth-child(n + 7) * { opacity: 0; pointer-events: none; }
    .sl-flex-carousel__nav { justify-self: center; gap: 12px; }
    .sl-flex-carousel__contents { gap: 14px; padding: 24px 16px 44px; }
    #slHomeFlexCarousel button { padding: .5em 1em; }
    #slHomeFlexCarousel .sl-flex-all-services { font-size: 14px; }
}
#slHomeFlexCarousel.sl-flex-resetting *,
#slHomeFlexCarousel.sl-flex-resetting *::after { transition: none !important; }
/* With JavaScript unavailable, every service and its normal link remain usable. */
#slHomeFlexCarousel:not([data-sl-flex-ready]) .sl-flex-carousel__list { flex-wrap: wrap; gap: 20px; padding-right: 12px; padding-left: 12px; }
#slHomeFlexCarousel:not([data-sl-flex-ready]) .sl-flex-carousel__item { flex: 1 1 320px; margin: 0; }
#slHomeFlexCarousel:not([data-sl-flex-ready]) .sl-flex-carousel__contents { width: 100%; pointer-events: auto; }
#slHomeFlexCarousel:not([data-sl-flex-ready]) .sl-flex-carousel__contents > * { opacity: 1; transform: none; }
#slHomeFlexCarousel:not([data-sl-flex-ready]) .sl-flex-carousel__item::after,
#slHomeFlexCarousel:not([data-sl-flex-ready]) .sl-flex-carousel__nav { display: none; }
@media (prefers-reduced-motion: reduce) {
    #slHomeFlexCarousel::before { animation: none !important; }
    #slHomeFlexCarousel *, #slHomeFlexCarousel *::after { transition: none !important; animation: none !important; }
}
