/* Formaspace section dock (shared) */
/* floating nav: bottom dock (mobile/tablet) → right rail (desktop) */
.cpw-dock {
    position: fixed;
    left: 50%;
    bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 45;
    width: min(46rem, calc(100vw - 1.25rem));
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        visibility 0.22s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

body.wfh-site-nav-open .cpw-dock {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(120%);
}

.cpw-dock__shell {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem;
    border-radius: 1.25rem;
    background: color-mix(in srgb, #ffffff 92%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 10px 30px rgba(12, 16, 23, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.7) inset;
    outline: 1px solid rgba(12, 16, 23, 0.06);
    opacity: var(--cpw-dock-portfolio-fade, 1);
}

.cpw-dock__head {
    display: none;
}

.cpw-dock__eyebrow {
    display: none;
}

.cpw-dock__toggle {
    display: none;
}

.cpw-dock__links {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.15rem;
    justify-content: space-evenly;
}

.cpw-dock__item {
    flex: 0 0 auto;
    min-width: 2.65rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.5rem 0.35rem;
    border-radius: 0.95rem;
    text-decoration: none;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.1;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.cpw-dock__item i,
.cpw-dock__item .cpw-dock__ico {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 0.95rem;
    line-height: 1;
    flex: 0 0 auto;
    display: block;
}

.cpw-dock__cta i,
.cpw-dock__cta .cpw-dock__ico {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 1.05rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cpw-dock__item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* bottom dock: label kecil gampang jadi D. / L. — pakai ikon saja */
@media (max-width: 1199px) {
    .cpw-dock__shell {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "nav cta";
        align-items: center;
        gap: 0.35rem;
    }

    .cpw-dock__head {
        display: none;
    }

    .cpw-dock__links {
        grid-area: nav;
        flex: none;
        width: 100%;
        min-width: 0;
        justify-content: space-evenly;
    }

    .cpw-dock__cta {
        grid-area: cta;
    }

    .cpw-dock__item {
        flex-direction: row;
        min-width: 2.7rem;
        width: 2.7rem;
        height: 2.7rem;
        padding: 0;
        gap: 0;
    }

    .cpw-dock__item span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
        opacity: 0;
        pointer-events: none;
    }

    .cpw-dock__item i,
    .cpw-dock__item .cpw-dock__ico {
        width: 1.15rem;
        height: 1.15rem;
        font-size: 1rem;
    }
}

.cpw-dock__item:hover {
    background: var(--cpw-soft);
    color: var(--cpw-ink);
}

.cpw-dock__item.is-active {
    background: var(--cpw-accent-soft);
    color: #4338ca;
}

.cpw-dock__cta {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.7rem;
    padding: 0 0.95rem;
    border-radius: 0.95rem;
    background: var(--cpw-ink);
    color: #fff !important;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
    transition: background 0.18s ease, transform 0.18s ease;
}

.cpw-dock__cta:hover {
    background: var(--cpw-accent);
    color: #fff !important;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .cpw-dock__shell {
        padding: 0.45rem 0.55rem;
        gap: 0.55rem;
    }

    .cpw-dock__item {
        width: 2.85rem;
        height: 2.85rem;
        min-width: 2.85rem;
    }

    .cpw-dock__cta {
        min-height: 2.85rem;
        padding: 0 1.15rem;
        font-size: 0.84rem;
        border-radius: 1rem;
    }
}

/* desktop: right side rail */
@media (min-width: 1200px) {
    .cpw-dock {
        left: auto;
        right: 1rem;
        bottom: auto;
        top: 50%;
        transform: translateY(-50%);
        width: auto;
        transition: none;
    }

    .cpw-dock__shell {
        flex-direction: column;
        align-items: stretch;
        width: 11.75rem;
        padding: 0.85rem 0.7rem 0.7rem;
        gap: 0.55rem;
        border-radius: 1.55rem;
        box-shadow:
            0 18px 40px rgba(12, 16, 23, 0.1),
            0 1px 0 rgba(255, 255, 255, 0.75) inset;
        /* radius jangan di-animate: pas width mengecil jadi oval jelek */
        transition:
            width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
            padding 0.28s cubic-bezier(0.22, 1, 0.36, 1),
            gap 0.28s ease;
    }

    .cpw-dock__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.35rem;
        min-height: 1.75rem;
        padding: 0 0.15rem;
    }

    .cpw-dock__eyebrow {
        display: block;
        margin: 0;
        font-size: 0.62rem;
        font-weight: 800;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #94a3b8;
        max-height: 1.2rem;
        opacity: 1;
        overflow: hidden;
        transition: opacity 0.2s ease, max-height 0.2s ease;
    }

    .cpw-dock__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.85rem;
        height: 1.85rem;
        border: 0;
        border-radius: 9999px;
        background: #f1f5f9;
        color: #475569;
        cursor: pointer;
        flex: 0 0 auto;
        transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    }

    .cpw-dock__toggle:hover {
        background: #eef0ff;
        color: #4338ca;
    }

    .cpw-dock__toggle-ico {
        width: 0.95rem;
        height: 0.95rem;
        transition: transform 0.28s ease;
    }

    .cpw-dock.is-compact .cpw-dock__toggle-ico {
        transform: rotate(180deg);
    }

    .cpw-dock__links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.18rem;
    }

    .cpw-dock__item {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0.7rem;
        width: 100%;
        padding: 0.72rem 0.8rem;
        border-radius: 1rem;
        font-size: 0.8rem;
        font-family: var(--cpw-font);
    }

    .cpw-dock__item i,
    .cpw-dock__item .cpw-dock__ico {
        width: 1.15rem;
        height: 1.15rem;
        text-align: center;
        font-size: 0.88rem;
        color: inherit;
        flex: 0 0 auto;
    }

    .cpw-dock__item span {
        opacity: 1;
        max-width: 8rem;
        transition: opacity 0.18s ease, max-width 0.22s ease;
    }

    .cpw-dock__item.is-active {
        background: linear-gradient(135deg, #eef0ff, #f5f4ff);
        color: #4338ca;
        box-shadow: inset 3px 0 0 #4338ca;
    }

    .cpw-dock__item:hover:not(.is-active) {
        transform: translateX(-1px);
    }

    .cpw-dock__cta {
        width: 100%;
        min-height: 2.85rem;
        margin-top: 0.15rem;
        padding: 0 0.9rem;
        border-radius: 1rem;
        font-size: 0.84rem;
        font-family: var(--cpw-font);
        justify-content: space-between;
    }

    .cpw-dock__cta-label {
        opacity: 1;
        max-width: 5rem;
        overflow: hidden;
        transition: opacity 0.18s ease, max-width 0.22s ease;
    }

    .cpw-dock__cta:hover {
        transform: translateY(-1px);
    }

    /* compact: icon rail (radius tetap, jangan 9999 biar ga oval di tengah animasi) */
    .cpw-dock.is-compact .cpw-dock__shell {
        width: 3.7rem;
        padding: 0.55rem 0.4rem;
        border-radius: 1.55rem;
        gap: 0.15rem;
        align-items: center;
    }

    .cpw-dock.is-compact .cpw-dock__head {
        justify-content: center;
        padding: 0;
        min-height: auto;
    }

    .cpw-dock.is-compact .cpw-dock__eyebrow {
        display: none;
    }

    .cpw-dock.is-compact .cpw-dock__toggle {
        width: 2.7rem;
        height: 2.7rem;
        background: #eef0ff;
        color: #4338ca;
    }

    .cpw-dock.is-compact .cpw-dock__links {
        align-items: center;
        gap: 0.1rem;
    }

    .cpw-dock.is-compact .cpw-dock__item {
        justify-content: center;
        width: 2.7rem;
        height: 2.7rem;
        padding: 0;
        gap: 0;
        border-radius: 9999px;
        color: #334155;
    }

    .cpw-dock.is-compact .cpw-dock__item .cpw-dock__ico {
        width: 1.2rem;
        height: 1.2rem;
        opacity: 1;
        visibility: visible;
    }

    .cpw-dock.is-compact .cpw-dock__item span,
    .cpw-dock.is-compact .cpw-dock__cta-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
        opacity: 0;
        pointer-events: none;
    }

    .cpw-dock.is-compact .cpw-dock__item.is-active {
        box-shadow: none;
        background: #eef0ff;
        color: #4338ca;
    }

    .cpw-dock.is-compact .cpw-dock__cta {
        width: 2.7rem;
        min-height: 2.7rem;
        height: 2.7rem;
        margin-top: 0.25rem;
        padding: 0;
        justify-content: center;
        border-radius: 9999px;
    }

    .cpw-dock.is-compact .cpw-dock__cta .cpw-dock__ico {
        width: 1.15rem;
        height: 1.15rem;
        color: #fff;
    }

    .cpw-page [id^="cpw-"] {
        scroll-margin-bottom: 1.5rem;
    }
}


/* clearance + scroll margin untuk app/home */
.fsa-page,
.fsh-page {
    padding-bottom: 0;
}

.fsa-page [id^="fsa-"],
.fsh-page [id^="fs-"] {
    scroll-margin-top: 6rem;
    scroll-margin-bottom: 5.5rem;
}

@media (min-width: 1024px) {
    .fsa-page [id^="fsa-"],
    .fsh-page [id^="fs-"] {
        scroll-margin-top: 6.5rem;
    }
}

@media (min-width: 1200px) {
    .fsa-page [id^="fsa-"],
    .fsh-page [id^="fs-"] {
        scroll-margin-bottom: 1.5rem;
    }
}

.cpw-dock {
    --cpw-ink: #0c1017;
    --cpw-soft: #eef0f6;
    --cpw-accent: #4f46c8;
    --cpw-accent-soft: #e7e6fb;
    --cpw-font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.cpw-dock__cta .fa-whatsapp {
    font-size: 1.05rem;
    line-height: 1;
}

.cpw-dock__item i.cpw-dock__ico,
.cpw-dock__cta i.cpw-dock__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ruang bawah biar dock mobile tidak nutupin CTA */
.fsa-cta {
    padding-bottom: calc(clamp(4rem, 8vw, 6.5rem) + 5.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

.fsh-cta {
    padding-bottom: calc(clamp(5rem, 8vw, 7.5rem) + 5.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

@media (min-width: 1200px) {
    .fsa-cta {
        padding-bottom: clamp(4rem, 8vw, 6.5rem) !important;
    }
    .fsh-cta {
        padding-bottom: clamp(5rem, 8vw, 7.5rem) !important;
    }
}

/* Sembunyikan dock bawah di mobile/tablet saat mode showcase cinema agar tidak penuh/menutup konten */
@media (max-width: 1199px) {
    body.fs-showcase-cinema .cpw-dock {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateX(-50%) translateY(140%) !important;
        transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }
}

/* Peleburan dock samping saat mode cinematic showcase (Desktop rail) */
@media (min-width: 1200px) {
    body.fs-showcase-cinema .cpw-dock__shell {
        background: rgba(15, 23, 42, 0.52) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.1) inset !important;
        outline: 1px solid rgba(255, 255, 255, 0.12) !important;
        transition: background 0.3s ease, outline 0.3s ease, box-shadow 0.3s ease;
    }

    body.fs-showcase-cinema .cpw-dock__item {
        color: rgba(255, 255, 255, 0.72) !important;
    }

    body.fs-showcase-cinema .cpw-dock__item:hover {
        background: rgba(255, 255, 255, 0.12) !important;
        color: #ffffff !important;
    }

    body.fs-showcase-cinema .cpw-dock__item.is-active {
        background: rgba(99, 102, 241, 0.4) !important;
        color: #c7d2fe !important;
    }

    body.fs-showcase-cinema .cpw-dock__cta {
        background: rgba(255, 255, 255, 0.16) !important;
        color: #ffffff !important;
    }

    body.fs-showcase-cinema .cpw-dock__cta:hover {
        background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    }
}

/* mobile/tablet: bottom dock off, rail kanan tetap di min-width 1200 */
@media (max-width: 1199px) {
    .cpw-dock {
        display: none !important;
    }

    .fsa-cta {
        padding-bottom: clamp(4rem, 8vw, 6.5rem) !important;
    }

    .fsh-cta {
        padding-bottom: clamp(5rem, 8vw, 7.5rem) !important;
    }
}
